Help with threads and queues
Help with threads and queues
- Subject: Help with threads and queues
- From: Paul Franz <email@hidden>
- Date: Thu, 29 Apr 2010 08:26:06 -0400
I am trying to convert my Java code to Objective-C code and I have run
into a problem. I have thread, that currently has a socket open and it
sits there and send packets of information through the socket.
Currently my queue code uses the wait/notifyAll methods in Java to put
the thread into a wait state (i.e. not actively checking and using
CPU) and to wake it up. The methods look like:
void push (String str)
{
queue.add(str);
notifyAll();
}
String pop ()
{
while (queue.isEmpty())
{
wait();
}
return queue.remove();
}
How do you do the samething in Cocoa/Objective-C?
Paul Franz
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden