• 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
NSMachPort thread safety
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMachPort thread safety


  • Subject: NSMachPort thread safety
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Sat, 1 Mar 2008 16:07:32 -0800

Some time ago, I implemented a simple threaded notification queue by following the example here:

http://developer.apple.com/documentation/Cocoa/Conceptual/Notifications/Articles/Threading.html

which basically adds an NSMachPort to the thread's runloop and calls - [NSPort sendBeforeDate:components:from:reserved:] to wake the thread up and allow it to process the enqueued notification. The same technique has worked well for queuing invocations, also. I recently noticed, however, that NSPort is explicitly listed as not being thread safe:

http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/chapter_950_section_2.html#/ /apple_ref/doc/uid/10000057i-CH12-SW4

Does this apply to NSMachPort as well? I filed a doc bug hoping for eventual clarification, but I'd rather know sooner rather than later if the code has to be rewritten. rdar://problem/5772256
_______________________________________________


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: NSMachPort thread safety
      • From: "Kyle Sluder" <email@hidden>
  • Prev by Date: Re: [NSOutlineView] How to know an item is expanded if its parent item is not?
  • Next by Date: Problems with ScriptingBridge and iTunes
  • Previous by thread: Re: [NSOutlineView] How to know an item is expanded if its parent item is not?
  • Next by thread: Re: NSMachPort thread safety
  • Index(es):
    • Date
    • Thread