On May 6, 2016, at 13:32 , Carl Hoefs <newsli...@autonomy.caltech.edu> wrote: > > Once in a while, NSOperationQueue -addOperation: throws an exception. I guess > this is a well-known bug going all the way back to 2008. I found Mike Ash's > writeup on the issue, and have downloaded his replacement class, > RAOperationQueue. However, it was written long ago for GC not ARC.
As a side issue, you didn’t give us any explicit references to Mike’s discussion, but looking back through his blog (mikeash.com/pyblog/use-nsoperationqueue.html), I see that he reported that *his* problem was fixed in 10.5.7: > "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.” These days, if I had any doubts about NSOperationQueue, I’d switch to using GCD directly. There’s very little that NSOperationQueue does that GCD doesn’t, and I must admit I’ve never regarded NSOperationQueue as superior**, apart from the fact that it got here first. (IIRC) NSOperationQueue started to displace raw threading only just before GCD arrived on the scene. ** There is, however, a small cloud hovering over GCD. This has been reported in the developer forums independently by different developers. Apparently, a GCD queue (under what circumstances isn’t clear) can use additional memory for each block that’s ever queued. That is, if a queue has historically run and disposed of N blocks, it will keep N * X bytes of memory around, even though its queue might currently be empty. The value of X is very small, so you have to go through tens of thousands of blocks before you’d even notice. It’s not clear if this is a memory leak, or a cache that would eventually stop increasing in size and/or be reclaimed. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com