• 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: Problem with detached thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with detached thread


  • Subject: Re: Problem with detached thread
  • From: Cameron Hayne <email@hidden>
  • Date: Thu, 4 Jul 2002 04:26:27 -0400

On Thursday, July 4, 2002, at 03:02 am, Laurent Daudelin wrote:
So, I thought I would detach the lengthy operation in a new thread. The
problem is that based on some stuff processed by this operation, I need to
display a window.

So, it seems to me that what you are asking is how to arrange to have your main thread notified when the worker thread is done. The "official" way to communicate between threads is via NSConnection but this seems overly complicated for simple things like what you want to do.

But I don't see why you can't have some object send addObserver to the defaultNotificationCenter in the main thread for some Notification that you make up. And then have your worker thread postNotification when it is done. I understand that notifications are received in the thread in which the addObserver is done - i.e. in this case, the main thread.

... Cameron
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
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.

References: 
 >Problem with detached thread (From: Laurent Daudelin <email@hidden>)

  • Prev by Date: Re: Invoking Plug-Ins Sample Code
  • Next by Date: Re: How does Pixie work?
  • Previous by thread: Problem with detached thread
  • Next by thread: Re: Problem with detached thread
  • Index(es):
    • Date
    • Thread