pthread_spin_lock, "memory" clobber missing ?

Riesch Nicolas Nicolas.Riesch@genevoise.ch
Wed Nov 16 10:50:00 GMT 2005


The code for locking spinlocks in Linux kernel contains a "memory"
clobber.
( see function "_raw_spin_lock(spinlock_t *lock)" at
http://lxr.linux.no/source/include/asm-i386/spinlock.h#L141 )

The code for function "pthread_spin_lock" in file
"nptl/sysdeps/i386/pthread_spin_lock.c" does not contain the "memory"
clobber.

Without "memory" clobber, I suppose the compiler may not flush registers
to memory before entering the spinlock code.
So, shouldn't it be added ?



**********************************************************************
This message is being transmitted to you without prior inspection 
by Geneva Insurance.

The message engages only the person who authored it and in 
no way is binding on Geneva Insurance.
The latter can under no circumstances be held responsible 
for the contents of this message, neither contractually nor in 
any other manner.

If the case arises, any commitments made by the author of 
this message in the name of Geneva Insurance have no legal 
validity unless confirmed in a letter duly signed by persons 
authorized to represent the company.

www.genevoise.ch
**********************************************************************



More information about the Libc-alpha mailing list