This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: DB_THREAD support in Berkeley DB/glibc
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: DB_THREAD support in Berkeley DB/glibc
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Tue, 28 Dec 1999 20:01:40 -0500
- cc: eek at escape dot ca, drow at false dot org, linuxppc-dev at lists dot linuxppc dot org, libc-alpha at sourceware dot cygnus dot com
>>>>> 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