• 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: Thu, 18 Dec 2008 11:10:05 -0700
  • Thread-topic: Thread ID in crash log

> But there's still a difference, right? And when called or passed through alot,
> that small difference can become really big.
...
> The fwrite was just an example. We actually do our debugging through memory
> first (ofcourse, there's still locking) and then another debugger thread does
> the writing so the real application threads do not have to block on the IO.

Let me put it this way: the difference is small enough that if you were
logging often enough for it to be a problem, then I you might well be
filling your hard disk with the log file ;-)

Actually, have you benchmarked to see how much you gain by not using fwrite
directly? I considered this approach, and then dropped it when I saw the
actual performance. Remember, if you're not forcing fsync, then your write
is buffered and you're not waiting for a disk write. Of course you are still
calling into the kernel and dealing with locking and communications between
process, so it is indeed faster to push something on to an in-process
queue--just not as a big a difference as I had expected.

And of course the other problem is that by having a background thread
writing out queued log messages, if your thread bug causes a crash, you'll
lose some number of the most recent log messages. That's what convinced me
in the end to go ahead and write directly--I needed the most recent messages
I could possibly get.

--
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

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

  • Prev by Date: Re: Performance of calculation on float point numbers in a array € NSNumber in NSArray, or classic C array?
  • Next by Date: Re: -[NSURLConnection cancel] doesn't release its delegate?
  • Previous by thread: Re: Thread ID in crash log
  • Next by thread: CALayer shadow and animation
  • Index(es):
    • Date
    • Thread