Indeed: the real answer is to use fast primitives inside
your fcntl lock code (;-))

--dave

Jeremy Allison wrote:
On Sun, Apr 23, 2006 at 04:27:21PM -0400, David Collier-Brown wrote:

  You can always check for a dead process if you save the
pid of the process which holds the lock.  Alas, this
is a slow operation, involving calling kill(pid, 0),
two process switches and a return.  As you
do relinquish the processor, that's not actually
evil, but is it something that conceivably could slow
you as much as the fcntl (;-))

 From some old measurements on my Sun, I **think** it's
faster than **my** fcntl... I really need to remeasure
with Solaris 10.


There's always a race though. You can crash after
you get the lock but before you write your own
PID. It's not atomic - for that you need kernel
support.

Jeremy.


--
David Collier-Brown,         | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
[EMAIL PROTECTED]           |                      -- Mark Twain
(416) 223-5943
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba

Reply via email to