Re: NSThread in Debug mode loading code issue
Re: NSThread in Debug mode loading code issue
- Subject: Re: NSThread in Debug mode loading code issue
- From: John Stiles <email@hidden>
- Date: Mon, 19 Jun 2006 18:12:31 -0700
All this means is that you have a timing-related bug.
On Jun 19, 2006, at 6:02 PM, Marc Van Olmen wrote:
I did some more research on this and currently it still think that
this is something weird during loading:
anObject = [[MyBitmap alloc] initWithContents:aPath];
In the: initWithContents:
first line of code I put NSLog(@"MyBitmap initWithContents");
and in case I create quickly 2 threads with same task/code
Online one time this "MyBitmap initWithContents" is printed in log
files and the second thread creates an empty object.
So when I wait a second between those threads everything is as
expected.
Also afterwards I have no problem in creating quickly a lot of
those similar threads.
regards,
marc
On 17 Jun 2006, at 16:57, Marc Van Olmen wrote:
On 17 Jun 2006, at 16:11, James Bucanek wrote:
I doubt this has anything to do with ZeroLink, other than the
timing of ZeroLink is probably exposing a race condition in your
code. Or, said another way, ZeroLink slightly purturbs the timing
of your application and you see the bug.
If I had to take a wild guess (and without any other details),
I'd say that anObject is probably a global or an instance
variable of an object and you've started two threads using the
same object. These two threads are, therefore, sharing the same
variable and one is clearing the value while the second thread is
trying to use it. This is pretty common multi-thread bug.
It is a local variable so not that case.
marc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden