Re: basic threading question: if parent thread completes
Re: basic threading question: if parent thread completes
- Subject: Re: basic threading question: if parent thread completes
- From: "Stephen J. Butler" <email@hidden>
- Date: Thu, 17 Sep 2009 17:32:24 -0500
On Thu, Sep 17, 2009 at 5:23 PM, Nick Rogers <email@hidden> wrote:
> Hi,
> I need to know this before going in for changes that are too complex.
>
> I spawned a thread from AppController (thread1).
> From thread1, I spawn another thread2.
> thread1 completes.
> Will thread2 terminate, give rise to anything else, or just keep on working
> usually?
Continue working; with the exception of the main thread, of course.
When the main thread terminates, the program exists, so all other
running threads are terminated/canceled/exited/whatever term you want
to use.
Note if you're using pthreads directly: all threads created should
eventually be joined on some thread (doesn't have to be the creator).
If you never intend to call pthread_join() on a thread, then call
pthread_detach().
_______________________________________________
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