svn commit: r208332 - in head/sys: amd64/include i386/include

Bruce Evans brde at optusnet.com.au
Sun May 23 13:15:16 UTC 2010


On Sun, 23 May 2010, Poul-Henning Kamp wrote:

> In message <20100523183502.C13588 at delplex.bde.org>, Bruce Evans writes:
>> On Thu, 20 May 2010, Poul-Henning Kamp wrote:
>
>> <machine/atomic.h> should be kernel-only.
>
> No, it absolutely should not, if anything, it should be pushed as
> international standards (with <sys/endian.h>, and <sys/queue.h>).
>
> Atomic operations and write barriers are necessary when multiple
> threads or processes cooperate using shared memory. and if anything
> the bug is that POSIX has not updated pthreads to have these and
> other necessary primitives.  (pthread_mutex_assert_held() for instance).

Pehraps, but <machine/atomic.h> was only designed, implemented and
documented for use in the kernel.  And of course any standardized version
won't look like the FreeBSD kernel one.  The kernel one is too bloated
for me, but a general-purpose one should be even more bloated so as
to support all types and more than atomic ops.

Bruce


More information about the svn-src-head mailing list