DB_THREAD support in Berkeley DB/glibc

David Edelsohn dje at watson.ibm.com
Wed Dec 29 12:01:40 EST 1999


>>>>> Geoff Keating writes:

>> If you only are using the TSL_UNSET in the context that one
>> already has the lock, then the lwarx/stwcx are unnecessary.  What you have
>> written, however, is not a general atomic clear macro.

Geoff> How is it not atomic?

	If this thread is the only one that can clear the cell, I think
that it is okay.  The store to acquire the lock also is atomic, but one
cannot simply store the value.  If the programming model allows contention
when clearing the word, one needs to use the lwarx/stwcx instructions.

David

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list