Re: Multithread communication
Re: Multithread communication
- Subject: Re: Multithread communication
- From: Bill Bumgarner <email@hidden>
- Date: Wed, 03 Feb 2010 11:24:44 -0800
What Kyle and Jens said, but there is one particular cardiac action impaired horse that I wanted to flog...
On Feb 3, 2010, at 8:30 AM, McLaughlin, Michael P. wrote:
> I thought that this should all be correct but somehow it crashes, at times
> immediately, at other times only when everything is done and, 90 percent of
> the time, not at all! I have attempted various remedies, including a static
> NSLock for getOpResults(), retaining the NSOperations for a while in the
> main thread, using a dependent signal to say that all threads should be
> finished, using a countdown int to say the same thing. So far, nothing has
> solved the problem.
No amount of locking around thread unsafe API will make said API thread safe. That is, you can't -- say -- put locks around your calls into the methods of -- say -- the AppKit and make the AppKit magically thread safe.
If you are using locks around code that you didn't write to "fix" threading issues, you aren't actually fixing anything (but you are guaranteed to be making for some terribly fun debugging sessions later).
b.bum
_______________________________________________
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