[parisc-linux] ldcw in __pthread_acquire

Alan Cox alan@lxorguk.ukuu.org.uk
Mon, 18 Dec 2000 00:36:06 +0000 (GMT)


> The apparent advantages are *strictly* short term.  A single mistake
> using a buzz lock from user code in a single process on a single computer
> can cost more time than all properly implemented buzz locks ever save.

The cost of a syscall against a rarely contended lock is huge. So you
test in user space, you spin enough times to cover SMP contentions then
you leap into the kernel since its a context switch away while the
other guy held the lock, which at maybe a 30 clock window is unlikely