Re: NSOperationQueue broken?
Re: NSOperationQueue broken?
- Subject: Re: NSOperationQueue broken?
- From: "Colin Barrett" <email@hidden>
- Date: Thu, 30 Oct 2008 19:16:22 -0700
On Thu, Oct 30, 2008 at 5:30 PM, Michael Ash <email@hidden> wrote:
> Based on the state of the program when it crashes, it appears that the
> problem is caused by a race condition which occasionally causes two of
> the worker threads that NSOperationQueue spawns to dequeue and execute
> the same NSOperation. Since an NSOperation is only supposed to run
> once, things fall down go boom. This is just a theory, mind, and I'm
> not sure of it yet.
I'm not sure it would help, but it might. You could try using the
dependency mechanism in addition to setting maxConcurrentOperations to
1. Keep track of the last NSOperation in your for loop and assign in
as you go.
If that fixes it, it could be a race in maxConcurrentOperations.
This is all highly speculative.
-Colin
_______________________________________________
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