• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: basic threading question: if parent thread completes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: basic threading question: if parent thread completes
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >basic threading question: if parent thread completes (From: Nick Rogers <email@hidden>)

  • Prev by Date: Re: click on sub-menu's super-item dismisses menu?
  • Next by Date: Re: click on sub-menu's super-item dismisses menu?
  • Previous by thread: basic threading question: if parent thread completes
  • Next by thread: Re: basic threading question: if parent thread completes
  • Index(es):
    • Date
    • Thread