• 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: Jean-Daniel Dupas <email@hidden>
  • Date: Fri, 18 Sep 2009 00:43:14 +0200


Le 18 sept. 2009 à 00:32, Stephen J. Butler a écrit :

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 that you can terminate the main thread (or any other thread) without affecting other threads by using the pthread_exit() function.


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().

-- Jean-Daniel




_______________________________________________

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


References: 
 >basic threading question: if parent thread completes (From: Nick Rogers <email@hidden>)
 >Re: basic threading question: if parent thread completes (From: "Stephen J. Butler" <email@hidden>)

  • Prev by Date: Re: click on sub-menu's super-item dismisses menu?
  • Next by Date: Re: [myNSWindow setDocumentEdited:dirtyB] fail ??
  • Previous by thread: Re: basic threading question: if parent thread completes
  • Next by thread: [SOLVED] Re: Matching braces and [NSTextView selectionRangeForProposedRange:granularity:];
  • Index(es):
    • Date
    • Thread