Re: NSOperationQueue bug with leopard 10.5.6?
On Fri, Jan 30, 2009 at 9:27 PM, Michael Ash michael@gmail.com wrote: On Fri, Jan 30, 2009 at 11:25 PM, Nick Zitzmann n...@chronosnet.com wrote: On Jan 30, 2009, at 6:32 PM, jurin...@eecs.utk.edu wrote: I attempted to use NSOperationQueue with NSInvocationOperations and after several frustrating days found multiple websights saying NSOperationQueue has a bug with Leopard 10.5, that will be fixed with 10.6. Q1: does anyone know when 10.6 is scheduled for release? No, we don't. The rule for nearly *any* unreleased apple product is: those who know can't say, and those who can say don't know. Q2: is there in fact a bug with 10.5 and NSOperationQueue? Yes, there is, but the likelihood that you'll trigger it is very, very low unless you have operations that are adding other operations (that are adding other operations, ...). If you don't, then there is nothing to worry about. If you do, then the workaround is to enqueue all operations in the main thread only. That is not the case. As far as I've been able to determine, the probability for causing a crash remains the same no matter where or how you add your operations, as long as there are at least two active queues in your application. All that matters for triggering the bug is the existence of multiple queues and the frequency with which you enqueue new operations. The probability is *roughly* (as in, I would not count on my estimate to be closer than an order of magnitude, if that) one in a million that any given operation will crash your program. If you're comfortable with those odds then go for it. Or if you can create only a single queue in your program and are confident that nobody else is going to create a second one in your process before Apple fixes the bug then go for it. First of all, thank you for shedding light on this bug; we're all benefiting from your investigations. Is this still the case if all operations are added on the main thread (i.e. even if they are added to multiple queues)? -Barry Mike ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/barrywark%40gmail.com This email sent to barryw...@gmail.com ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSOperationQueue bug with leopard 10.5.6?
On Mon, Feb 2, 2009 at 1:59 PM, Barry Wark barryw...@gmail.com wrote: First of all, thank you for shedding light on this bug; we're all benefiting from your investigations. Thank you very much for saying so, it's much appreciated. Is this still the case if all operations are added on the main thread (i.e. even if they are added to multiple queues)? Yep! Check out this update: http://www.mikeash.com/?page=pyblog/dont-use-nsoperationqueue.html#comment-92c5b275246162678df037125f3ff3a7 Bottom line: that sample code uses a single NSOperationQueue, only adds operations from the main thread, and does absolutely no funny business whatsoever. Still crashes reliably and repeatedly. At this point it seems that your choices are either to accept that your code may have a roughly one in a million chance of crashing for each NSOperation you enqueue, or avoid using NSOperationQueue. (Or hope Apple fixes it before you ship, I suppose.) Here's hoping Apple decides to fix it for 10.5. It would be unfortunate to have this otherwise very nice API remain broken for an entire major OS cycle. If this affects you, please file a bug with Apple. The more people who file bugs, the greater the chance that something will be done. If you do, please feel free to reuse my test case (and actually trying it first would be a good idea too), and if you like you can reference my original bug which is rdar://6332143 . Mike ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSOperationQueue bug with leopard 10.5.6?
I have a MacPro with dual quad processors, and would LOVE to be able to multiprocess a computationally intense app I have developed. My current OS is Leopard 10.5.6 I attempted to use NSOperationQueue with NSInvocationOperations and after several frustrating days found multiple websights saying NSOperationQueue has a bug with Leopard 10.5, that will be fixed with 10.6. Q1: does anyone know when 10.6 is scheduled for release? Q2: is there in fact a bug with 10.5 and NSOperationQueue? Thankyou, Ron Jurincie jurin...@eecs.utk.edu ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSOperationQueue bug with leopard 10.5.6?
On Jan 30, 2009, at 6:32 PM, jurin...@eecs.utk.edu wrote: I attempted to use NSOperationQueue with NSInvocationOperations and after several frustrating days found multiple websights saying NSOperationQueue has a bug with Leopard 10.5, that will be fixed with 10.6. Q1: does anyone know when 10.6 is scheduled for release? No, we don't. Q2: is there in fact a bug with 10.5 and NSOperationQueue? Yes, there is, but the likelihood that you'll trigger it is very, very low unless you have operations that are adding other operations (that are adding other operations, ...). If you don't, then there is nothing to worry about. If you do, then the workaround is to enqueue all operations in the main thread only. FWIW, I've added thousands of operations to a single queue at once in the main thread with no problems. Nick Zitzmann http://www.chronosnet.com/ ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSOperationQueue bug with leopard 10.5.6?
On Fri, Jan 30, 2009 at 11:25 PM, Nick Zitzmann n...@chronosnet.com wrote: On Jan 30, 2009, at 6:32 PM, jurin...@eecs.utk.edu wrote: I attempted to use NSOperationQueue with NSInvocationOperations and after several frustrating days found multiple websights saying NSOperationQueue has a bug with Leopard 10.5, that will be fixed with 10.6. Q1: does anyone know when 10.6 is scheduled for release? No, we don't. The rule for nearly *any* unreleased apple product is: those who know can't say, and those who can say don't know. Q2: is there in fact a bug with 10.5 and NSOperationQueue? Yes, there is, but the likelihood that you'll trigger it is very, very low unless you have operations that are adding other operations (that are adding other operations, ...). If you don't, then there is nothing to worry about. If you do, then the workaround is to enqueue all operations in the main thread only. That is not the case. As far as I've been able to determine, the probability for causing a crash remains the same no matter where or how you add your operations, as long as there are at least two active queues in your application. All that matters for triggering the bug is the existence of multiple queues and the frequency with which you enqueue new operations. The probability is *roughly* (as in, I would not count on my estimate to be closer than an order of magnitude, if that) one in a million that any given operation will crash your program. If you're comfortable with those odds then go for it. Or if you can create only a single queue in your program and are confident that nobody else is going to create a second one in your process before Apple fixes the bug then go for it. Mike ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com