Date: Tue, 04 Jun 2013 10:19:20 +0200 From: Andre Oppermann <andre@freebsd.org> To: Ed Schouten <ed@80386.nl> Cc: freebsd-mips@freebsd.org, freebsd-arch@freebsd.org Subject: Re: Kernelspace C11 atomics for MIPS Message-ID: <51ADA308.6040904@freebsd.org> In-Reply-To: <CAJOYFBD502MYbkVR2hnVDTYWOvOUr15=OPyjotNvv%2BZ09vQ1OQ@mail.gmail.com> References: <CAJOYFBD502MYbkVR2hnVDTYWOvOUr15=OPyjotNvv%2BZ09vQ1OQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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). Atomics and locks are difficult enough to get right and reason about even with our rather good API and I scream in fear thinking about everyone(tm) doing their own "optimized" lock or even forgoing it because "it's atomic". I would even propose to go as far as disbarring the use of C11 atomics in the kernel other than inside the officially supported lock API. -- Andre
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51ADA308.6040904>