From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 21 Jun 2010 12:43:59 -0400 To: 9fans@9fans.net Message-ID: <916c594b0cded9f4aa80ad29797b4a81@ladd.quanstro.net> In-Reply-To: References: <97d3416a6d7cadb18e8723fff3d2e2a8@hamnavoe.com> <81727c869e97f501968f868ee8794852@kw.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] interesting timing tests Topicbox-Message-UUID: 3606da82-ead6-11e9-9d60-3106f5b1d025 On Mon Jun 21 10:51:30 EDT 2010, quanstro@quanstro.net 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