Re: Thread ID in crash log
Re: Thread ID in crash log
- Subject: Re: Thread ID in crash log
- From: Scott Ribe <email@hidden>
- Date: Wed, 17 Dec 2008 22:54:09 -0700
- Thread-topic: Thread ID in crash log
> calling CrashLogThreadID(pthread_t) might be too costly for every
> call to my custom debugLog(...)
I've done it that way when debugging threads. It doesn't take long; none of
the calls take very long, especially when compared to what goes on when
writing to a log anyway.
Do note though that writing to streams has to lock something underneath so
that writes from multiple threads don't intermingle, which means that adding
more logging can sometimes disguise your threading bugs by adding
synchronization points near where your problems are. The joys of threads!
Also note that when running on the debugger, the locking is not right for
some reason, so output from multiple threads can get intermingled. But this
doesn't happen in production builds. I don't know whether it's a gdb
interaction or some debug library that causes it... BTW, I'm talking here
about stdout & cout--I don't know if NSLog has the same issue because I
don't use it very much.
--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice
_______________________________________________
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