TDB locking overhead and performance...

Jeremy Allison jra at samba.org
Sun Apr 23 20:29:56 GMT 2006


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.


More information about the samba-technical mailing list