Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2001 13:12:49 -0700
From:      "Justin T. Gibbs" <gibbs@scsiguy.com>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Bruce Evans <bde@zeta.org.au>, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Wilko Bulte <wkb@freebie.demon.nl>, Poul-Henning Kamp <phk@critter.freebsd.dk>, Peter Wemm <peter@netplex.com.au>
Subject:   Re: cvs commit: src/sys/i386/conf GENERIC 
Message-ID:  <200101152012.f0FKCns56756@aslan.scsiguy.com>
In-Reply-To: Your message of "Mon, 15 Jan 2001 11:47:17 PST." <XFMail.010115114717.jhb@FreeBSD.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
>So are you ready to write the code in trap() to handle an illegal instruction
>fault in userland that decodes and executes all variants of cmpxchg?  The new
>threading code in libc will be using atomic_cmpset() from userland, which is
>going to be the main hurdle to get over.

This is the wrong way to handle it.  Have atomic_cmpset() perform a fixup
of the calling code on first entry and the result will be code as optimized
as possible for the processor type the code is running on.  If the user
decides to write their own code that uses cmpxchg, they get what they
deserve, but the primitives should not require a *fault* to work correctly.

This is not a new idea and it honestly surprises me that everyone in
this discussion seems to be avoiding the obvious and time tested solution
for this kind of problem.

BTW, this type of thing gives you the oportunity to optimize for any
type of CPU, so the benefit is not necessarily i386 specific.

--
Justin


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?200101152012.f0FKCns56756>