community.borland.com

Article #25450: What does the LOCK_ACQUIRE_SPINS parameter do?

Problem:
The ibconfig file (IB5/NT4) offers the LOCK_ACQUIRE_SPINS 
parameter.  The operation manual just says about it  "Number 
of spins during a busy wait on the lock table mutex. Only  
relevant on SMP machines. Default: 0." 

I have a SMP machine. Can I perhaps achieve better performance by 
increasing the value of this  parameter? And what is a "spin"?


Solution:
The information in this article applies to:
* InterBase 5.x

The lock spin parameter has to do with multiple processors
attempting to access the same piece of lock code for threads
in the kernel simultaneously.  The spin lock is a counter which
adds an effective wait between the time a lock is requested
(which is held by the other processor), and the time a timeout
condition occurs.  If a timeout occurs, the request will fail
and have to be rescheduled.

In general, as long as a lock will be acquired in a reasonable
time (reasonable being defined by the user), it is more
efficient to wait.  If a dead lock condition occurs or some
other resource is blocking the spin lock, it may be more
efficient to fail and go on.  Typically, the answer is
determined by experimentation, as there are too many
variables (hardware speed, type of query, database design,
etc.) to develop an imperical answer in a useful amount of
time/resources.



Last Modified: 27-OCT-00