• 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: NSOperationQueue emptying
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSOperationQueue emptying (From: "McLaughlin, Michael P." <email@hidden>)

  • Prev by Date: NSFile and NSTask
  • Next by Date: Re: NSTableView's delegate dataCellForTableColumn never called
  • Previous by thread: NSOperationQueue emptying
  • Next by thread: NSFile and NSTask
  • Index(es):
    • Date
    • Thread