• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSThread in Debug mode loading code issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSThread in Debug mode loading code issue


  • Subject: Re: NSThread in Debug mode loading code issue
  • From: Marc Van Olmen <email@hidden>
  • Date: Mon, 19 Jun 2006 21:02:08 -0400

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: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSThread in Debug mode loading code issue
      • From: John Stiles <email@hidden>
References: 
 >Re: NSThread in Debug mode loading code issue (From: James Bucanek <email@hidden>)
 >Re: NSThread in Debug mode loading code issue (From: Marc Van Olmen <email@hidden>)

  • Prev by Date: Excluding native file type from export sheet.
  • Next by Date: Re: NSThread in Debug mode loading code issue
  • Previous by thread: Re: NSThread in Debug mode loading code issue
  • Next by thread: Re: NSThread in Debug mode loading code issue
  • Index(es):
    • Date
    • Thread