This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: DB_THREAD support in Berkeley DB/glibc


>>>>> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]