Re: simple thread communication
Re: simple thread communication
- Subject: Re: simple thread communication
- From: Nicko van Someren <email@hidden>
- Date: Tue, 13 Apr 2004 15:02:28 +0100
On 13 Apr 2004, at 14:37, Devon E Bowen wrote:
I need to call gethostbyname() but I don't want my program to block
if DNS is not available. So I spin off a separate thread to call
gethostbyname() and set a variable with the answer. This happens
while the main thread goes back to its run loop so there is no
blocking at all. Very simple.
But I need a way of informing the main thread that the subthread
is finished.
Have you looked at the NSObject method
performSelectorOnMainThread:withObject:waitUntilDone: ? I think this
will do what you need.
Nicko
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.