Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Oct 2001 23:29:21 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, Poul-Henning Kamp <phk@critter.freebsd.dk>
Subject:   Re: cvs commit: src/sys/i386/include atomic.h
Message-ID:  <XFMail.011008232921.jhb@FreeBSD.org>
In-Reply-To: <200110090616.f996GpE10358@earth.backplane.com>

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

On 09-Oct-01 Matt Dillon wrote:
> 
>:
>:In message <200110090434.f994Yam09790@earth.backplane.com>, Matt Dillon
>:writes:
>:>   I don't think it's a good idea to expose the atomic_*() ops or any other
>:>   SMP mechanisms in the kernel to userland.
>:
>:If we are going to be serious about threads, we need to expose some kind
>:of atomic ops to userland.
>:
>:I can't see why they could not be the same as we use in the kernel...
>:
>:-- 
>:Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> 
>     How platform independant do you want to be?  If you want userland
>     atomic ops, they should be entirely separate from the kernel and
>     almost certainly use a different API.  Frankly I think having userland
>     atomic ops at all is a terrible idea, especially after all the hell
>     people doing the alpha and IA64 ports went through (are going through?)
>     with the current kernel atomic ops.

Erm, what "hell" regarding the current atomic ops exactly?  The current method
of handling memory barriers is quite ia64 friendly and works on alpha, ia64,
sparc64, and ppc so far (and x86).  The only really critical ops are
atomic_cmpset() (you could build everythign else up from that).

>     It is far better to have *high* level userland operations, like userland
>     mutexes (which BTW should be entirely independant of kernel mutexes),
>     and not expose low level so-called atomic ops to userland at all.

How does one implement the userland mutexes w/o atomic operations?  I agree
they don't need to be the same code as kernel mutexes as the "hard" cases where
you block a thread, etc. will definitely be entirely different.

>                                               -Matt

-- 

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.011008232921.jhb>