On Mon Jun 21 10:51:30 EDT 2010, [email protected] wrote:
> void
> lock(ulong *l)
somehow lost was an observation that since lock
is only testing that next == owner, and that both
are based on the current state of *l, i don't see how
this is robust in the face of more than one mach
spinning. who wins? am i missing something?
also lost was the assembly which should be (from
memory) something like
TEXT _xadd(SB), 1, $0
MOVL l+0(FP), BX
MOVL n+4(FP), AX
LOCK; XADD AX, 0(BX)
RET
unfortunately that is not accepted by the assembler,
and (hopefully) equivalent BYTE statements were
rejected by the linker. perhaps someone knows immediately
how to sneak XADD in; i haven't yet investigated.
- erik