Re: Atomic operations on i386/amd64

From: Doug Rabson <dfr_at_nlsystems.com>
Date: Fri, 6 Aug 2004 09:31:29 +0100
On Friday 06 August 2004 03:30, Bruce M Simpson wrote:
> On Thu, Aug 05, 2004 at 04:15:32PM -0600, Scott Long wrote:
> > >>Is there any particular reason why atomic_load_acq_*() and
> > >>atomic_store_rel_*() are implemented with CMPXCHG and XCHG
> > >> instead of MOV on i386/amd64 UP?
>
> Have a look at Linux. They ended up doing a runtime self-modifying
> kernel hack so they could ship generic kernels which used the
> appropriate locking instructions on each x86 family CPU.

I also really like the way the kernel exports a page containing 'the 
best syscall sequence' for the current processor.
Received on Fri Aug 06 2004 - 06:31:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:05 UTC