Re: Kernel Panic when writing to disk [update]
Re: Kernel Panic when writing to disk [update]
- Subject: Re: Kernel Panic when writing to disk [update]
- From: Justin Walker <email@hidden>
- Date: Mon, 21 Jun 2004 08:03:54 -0700
On Jun 21, 2004, at 1:44, Matthieu Kopp wrote:
Hi,
After spending a few more hours on the problem, I finally found what
was causing
the panic...and more importantly for me, how to avoid it.
I am still posting a bug to Apple, because as you mentioned it, this
should never
happen.
Be sure to add this to your bug report :-}
What triggers the panic in my application is the following: my
application is multi-threaded
and as I mentionned, I have one thread saving data at regular
intervals (using writeToFile:atomically
of NSData).
Another thread is triggered by a timer and is checking the amount of
free disk space every second
using :
Maybe I'm unclear on what is going on, but it seems to be a terrific
waste of resources to check once per second, on a thread devoted to
that task, for freespace. Wouldn't it be better to check before you do
the write?
In general, polling is A Bad Thing, except in dedicated devices (and
then, only when the polling doesn't involve "going external"). There
are always exceptions, but you should try to design polling out of your
application.
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | It's not whether you win or
lose...
| It's whether *I* win or lose.
*--------------------------------------*-------------------------------*
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.