TDB locking overhead and performance...

David Collier-Brown davec-b at
Sun Apr 23 20:39:42 GMT 2006

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


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
davecb at           |                      -- Mark Twain
(416) 223-5943

More information about the samba-technical mailing list