[parisc-linux] ldcw in __pthread_acquire
Alan Cox
alan@lxorguk.ukuu.org.uk
Sun, 17 Dec 2000 02:38:10 +0000 (GMT)
> User code should never do LDCW calls ... we've just seen yet another
> example of why: it's difficult to do correctly. Providing fast
> locking mechanisms is the *kernel's* job.
There are good reasons for doing buzzlocks in user space
> for a very short time, so the spin loop is acceptable ... but ... yes,
> things happen ... and sometimes the programmer is wrong, and that
> can have tragic consequences. A kernel-implemented fast-lock would
> presumably ...like on MPE/iX ... have a max number of hard loops,
> and then revert to a blocking-lock of some kind.
Thats how Mozilla does it, and with a short spin in user space performance
is way higher than always bugging the kernel