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 a whole book full of them. It's available for iBooks and Kindle, plus a direct download in PDF and ePub format. It's also available in paper for the old-fashioned. Click here for more information.

Comments:

Marc Charbonneau at 2009-05-13 08:49:21:
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.

bayoubengal at 2009-05-19 00:07:02:
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.

-James

Jerry Isdale at 2009-08-06 09:05:01:
Rumor has it they didnt fix anything directly in NSOperationQueue, but according to:
http://macosrumors.com/2009/03/29/macosx-1057-build-9j39-seeded/
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.

mikeash at 2009-08-06 10:23:01:
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.

Name:
Web site:
Comment:
Formatting: <i> <b> <blockquote> <code>. URLs are automatically hyperlinked.
Hosted at DigitalOcean.