Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Oct 2001 11:16:24 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   RE: cvs commit: src/sys/i386/include atomic.h
Message-ID:  <XFMail.011011111624.jhb@FreeBSD.org>
In-Reply-To: <Pine.BSF.4.21.0110111150190.37124-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 11-Oct-01 Julian Elischer wrote:
> can you point to a single '386 based SMP machine that we will ever
> support?

SMP is not the problem.  The problem is how does your binary work on both a
Dual PentiumII and a 386?   The version of atomic_cmpset() that works on a 386
won't work on the Dual Pentium II because it isnt' really atomic.  The version
of atomic_cmpset() that works on a Dual Pentium II won't work on the 386
because it will result in an illegal instruction fault since the 386 doesn't
have cmpxchg.  One workaround is what the run time linker does for its locks
which is to use a runtime check to see if you are on a 386 and call different
primitives for your lock in that case.  Ugh.

> On Mon, 8 Oct 2001, John Baldwin wrote:
> 
>> 
>> On 08-Oct-01 John Baldwin wrote:
>> > jhb         2001/10/08 13:58:25 PDT
>> > 
>> >   Modified files:
>> >     sys/i386/include     atomic.h 
>> >   Log:
>> >   Allow atomic ops to be somewhat safely used in userland.  We always use
>> >   lock prefixes in the userland case so that the binaries will work on
>> >   both
>> >   SMP and UP systems.
>> 
>> atomic_cmpset(), atomic_store(), and atomic_load() are still problematic as
>> there are 386 versions which are not SMP safe and non-386 versions which are
>> SMP safe.  A userland sourc file that uses atomic ops on x86 will have to
>> define I386_CPU if it wishes to compile the 386 versions, otherwise it will
>> use
>> the 486+ and SMP safe versions.  This just means that if any userland
>> applications (such as possibly the new KSE thread library) use these atomic
>> ops, it will have to have separate versions for 386's and everything else in
>> the x86 family.
>> 
>> -- 
>> 
>> John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
>> PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
>> "Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
>> 
> 

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.011011111624.jhb>