Re: NSOperationQueue emptying
Re: NSOperationQueue emptying
- Subject: Re: NSOperationQueue emptying
- From: "Adam R. Maxwell" <email@hidden>
- Date: Thu, 27 Aug 2009 08:40:15 -0700
On Aug 27, 2009, at 8:18 AM, McLaughlin, Michael P. wrote:
I'm wondering about the timing of NSOperationQueue emptying.
In my Objective-C++ (Leopard) app, I have one opQueue of operations
and the
very last thing each operation does is enqueue the results of a
computation
back to the main thread.
NSPointerArray *ptr = [NSPointerArray pointerArrayWithStrongObjects];
[ptr addPointer:&PL];
[mainQueue enqueueNotification:[NSNotification
notificationWithName:@"compNotif"
object:ptr]
postingStyle:NSPostNow];
} // end of main()
If this is the main thread's NSNotificationQueue, you can only use it
from the main thread, since it's listed as being unsafe to use from
multiple threads:
http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html
Your usage could cause all sorts of hard-to-diagnose problems, unless
I misread what you're doing.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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