NSMachPort thread safety
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