Re: [PATCHv2] attr: convert to new threadsafe API
- From
Jacob Keller <jacob.keller@gmail.com>
- Date
- Oct 12, 2016, 21:45 UTC
- Message-ID
- <CA+P7+xqBUT3jUsxciVydO+nRoR+iJygWG=y_ARpiQSs+-kcH2A@mail.gmail.com>
- In-Reply-To
- <44c554b8-7ac1-047d-59f0-b4d5331ed496@kdbg.org>
On Wed, Oct 12, 2016 at 1:07 PM, Johannes Sixt <j6t@kdbg.org> wrote:
Show 13 quoted lines
> > Sigh. DCLP, the Double Checked Locking Pattern. These days, it should be > common knowledge among professionals that this naïve version _does_not_work_ > [1]! > > I suggest you go without it, then measure, and only *then* optimize if it is > a bottleneck. Did I read "we do not expect much contention" somewhere? > > [1] http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf C++ centric, > but applies to C just as well > > -- Hannes >
You know, I always wondered why Linux Kernel code needed memory barriers but userspace programs didn't seem to use them.. turns out they actually *do* need them for the same exact types of problems...
Thanks, Jake