• 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: Thread ID in crash log
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Thread ID in crash log
      • From: radj <email@hidden>
References: 
 >Re: Thread ID in crash log (From: radj <email@hidden>)

  • Prev by Date: Re: Pressable Button
  • Next by Date: Core Animation glitch
  • Previous by thread: Re: Thread ID in crash log
  • Next by thread: Re: Thread ID in crash log
  • Index(es):
    • Date
    • Thread