Re: Some interesting results from tweaking spinlocks - Mailing list pgsql-hackers

From mlw
Subject Re: Some interesting results from tweaking spinlocks
Date
Msg-id 3C3717A1.C50D65C9@mohawksoft.com
Whole thread Raw
In response to Some interesting results from tweaking spinlocks  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
mlw wrote:
[snip]
#define SPINS_PER_DELAY         2000
#define DELAY_MSEC              10
#define TIMEOUT_MSEC            (60 * 1000)
       ATOMIC_INC(lock->waiters);
       while (TAS(lock))       {               if ( (++spins > SPINS_PER_DELAY) || (lock->waiters >= CPUS) )
  {                       if (++delays > (TIMEOUT_MSEC / DELAY_MSEC))                               s_lock_stuck(lock,
file,line);
 
                       delay.tv_sec = 0;                       delay.tv_usec = DELAY_MSEC * 1000;
(void)select(0, NULL, NULL, NULL, &delay);
 
                       spins = 0;               }       }       ATOMIC_DEC(lock->waiters);


This is better function, the one in my previous post was non-sense, I should
have coffee BEFORE I post.


pgsql-hackers by date:

Previous
From: mlw
Date:
Subject: Re: Some interesting results from tweaking spinlocks
Next
From: "Marc G. Fournier"
Date:
Subject: Re: RC1 time?