Date: Tue, 4 Jun 2013 09:52:51 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-arch@freebsd.org Cc: Ed Schouten <ed@80386.nl>, Andre Oppermann <andre@freebsd.org>, freebsd-mips@freebsd.org Subject: Re: Kernelspace C11 atomics for MIPS Message-ID: <201306040952.51513.jhb@freebsd.org> In-Reply-To: <51ADA308.6040904@freebsd.org> References: <CAJOYFBD502MYbkVR2hnVDTYWOvOUr15=OPyjotNvv%2BZ09vQ1OQ@mail.gmail.com> <51ADA308.6040904@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, June 04, 2013 4:19:20 am Andre Oppermann wrote: > On 03.06.2013 16:04, Ed Schouten wrote: > > Hi, > > > > As of r251230, it should be possible to use C11 atomics in > > kernelspace, by including <sys/stdatomic.h>! Even when not using Clang > > (but GCC 4.2), it is possible to use quite a large portion of the API. > > I'm a bit wary of *kernel* developers using C11-native atomics as opposed > to our own atomic API. This could lead to a proliferation of home-grown, > more or less correctly working, locks and variants thereof (mostly less > correct). I think this is not a big deal to worry about as developers have already been free to do this via <machine/atomic.h> and haven't gone super crazy. Replacing <machine/atomic.h> with <sys/stdatomic.h> is probably fine and should be a simple drop-in replacement for our lock implementations. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306040952.51513.jhb>