• 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: Best way to push action from 1 thread to another?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to push action from 1 thread to another?


  • Subject: Re: Best way to push action from 1 thread to another?
  • From: Mike Laster <email@hidden>
  • Date: Thu, 09 May 2002 10:37:47 -0400

On 5/9/02 12:44 AM, "Cryx" <email@hidden> wrote:

> Try using true notifications sent via a notification center. The
> receiver is hooked nicely into your event loop, ala what you are doing
> now. It's probably more efficient, but it's at a minimum far fewer
> lines of code and more maintainable.

Did NSNotificationCenter change? The last time I looked at it, it wasn't
hooked into the run loop. Whenever a notification was posted, the callout
to registered listeners was executed in the context of the thread that
posted the message, which is not necessarily the thread of the listener.

This would make it useless for getting around AppKit thread safety issues,
since if you registered a listener in your main thread (the one you can
safely call AppKit from), your handler code could be executed in a different
thread context, and still not be allowed to talk to AppKit.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Best way to push action from 1 thread to another?
      • From: email@hidden
References: 
 >Re: Best way to push action from 1 thread to another? (From: Cryx <email@hidden>)

  • Prev by Date: Re: Saving NSColor
  • Next by Date: RE: Saving NSColor
  • Previous by thread: Re: Best way to push action from 1 thread to another?
  • Next by thread: Re: Best way to push action from 1 thread to another?
  • Index(es):
    • Date
    • Thread