Thread (3 messages) 3 messages, 3 authors, 1999-12-28

Re: DB_THREAD support in Berkeley DB/glibc

From: Tony Mantler <hidden>
Date: 1999-12-28 23:21:36

Possibly related (same subject, not in this thread)

At 4:28 PM -0600 12/28/99, David Edelsohn wrote:
The TSL_UNSET still does not look sufficient to me.  It needs to
use lwarx/stwcx as well:

#define TSL_UNSET(tsl) ({
register tsl_t *__l = (tsl);
register tsl_t __r1;
__asm__ __volatile__ ("
       sync
          10: lwarx   %0,0,%1
       stwcx.  %2,0,%1
              bne-    10b
       isync"
        : "=&r" (__r1) : "r" (__l), "r" (0));
       })
Why? It would seem to me that the only time that atomic code would be
tripped is if the calling thread didn't have the lock when it tried to
clear it (umm, biiiig no-no), and a different thread tried to set the lock
at the same time.

I would agree with Daniel Jacobowitz's code, all that should be needed is a
sync and write for the unset.


Cheers - Tony :)


--
Tony Mantler         Renaissance Nerd Extraordinaire         eek@escape.ca
Winnipeg, Manitoba, Canada                       http://www.escape.ca/~eek


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help