mikeash.com: just this guy, you know?

Posted at 2009-05-12 21:18 | RSS feed (Full text feed) | Blog Index
Next article: Friday Q&A 2009-05-22: Objective-C Class Loading and Initialization
Previous article: Nanogolf
Tags: nsoperationqueue osbug
Use NSOperationQueue
by Mike Ash  

Mac OS X 10.5.7 has shipped and includes a fix for the NSOperationQueue bug that I discovered late last year. I have run all of my old test cases against 10.5.7 and it appears to perform as advertised. As far as I can see, NSOperationQueue is now safe to use. I'm glad that my prediction of no fix until Snow Leopard turned out to be wrong. Enjoy!

Did you enjoy this article? I'm selling whole books full of them! Volumes II and III are now out! They're available as ePub, PDF, print, and on iBooks and Kindle. Click here for more information.


That's good to know. I may not ship an app with it before Snow Leopard gets out the door, but I've been using NSOperationQueue pretty much since I started programming with Leopard.
We had a problem with operations getting stuck in the queue and never running. We did work around the crash by putting a @catch block in the a subclass that overrides start.

However, our tests with 10.5.7 show no sign of the operations getting hung up.

Rumor has it they didnt fix anything directly in NSOperationQueue, but according to:
there is a:
 Fixed problem with NSOperationQueue and PThreads
which was a deeper PThreads fix.
This may have fully fixed the noted bug, or it may just have moved it somewhere.
Empirical testing (such as your test cases) shows it is gone. But proving something doesn't exist is always hard.
I don't think the location of the fix is relevant, since we don't know the location of the bug in the first place.

As for whether the bug is still there, there's a bunch of evidence that it's not (Apple says they fixed it, and neither I nor a bunch of others can reproduce it) and zero evidence that it is. That doesn't mean it's gone, but I see no reason to assume it's still there until and unless some evidence is discovered to that effect.

Comments RSS feed for this page

Add your thoughts, post a comment:

Spam and off-topic posts will be deleted without notice. Culprits may be publicly humiliated at my sole discretion.

The Answer to the Ultimate Question of Life, the Universe, and Everything?
Formatting: <i> <b> <blockquote> <code>.
NOTE: Due to an increase in spam, URLs are forbidden! Please provide search terms or fragment your URLs so they don't look like URLs.
Hosted at DigitalOcean.