• 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: Obj-C runtime not thread-safe?!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obj-C runtime not thread-safe?!


  • Subject: Re: Obj-C runtime not thread-safe?!
  • From: Marcel Weiher <email@hidden>
  • Date: Sat, 19 Jun 2004 16:40:16 +0100

On 18 Jun 2004, at 10:24, Charles Srstka wrote:

I have written a little sample program that will demonstrate this. Of course, if you run it normally, the Thing class will initialize almost instantly and the problem will not occur. But, at least on my G4/450 DP, running this in the debugger slows it down enough to make this problem occur. Uncomment the first NSLog in Thing.m to see that one of the threads isn't getting the class object.

Hmm...I can't reproduce this even in the debugger, but my machine is faster. However, it seems more likely that NSLog() isn't thread-safe. Have you tried something other than NSLog?

- (void)doSomethingInNewThread {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

//NSLog(@"Thing class is %@",[Thing class]);
Thing *thing = [Thing thing];
NSLog(@"thing is %@",thing);

[pool release];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Obj-C runtime not thread-safe?! (From: Charles Srstka <email@hidden>)
 >Re: Obj-C runtime not thread-safe?! (From: j o a r <email@hidden>)
 >Re: Obj-C runtime not thread-safe?! (From: Charles Srstka <email@hidden>)

  • Prev by Date: Making an 'Open with' menu
  • Next by Date: Re: Dynamic NSTextView resizing while keeping Y position constant?
  • Previous by thread: Re: Obj-C runtime not thread-safe?!
  • Next by thread: Re: Obj-C runtime not thread-safe?!
  • Index(es):
    • Date
    • Thread