From: Junio C Hamano Date: Wed, 12 Oct 2016 21:38:10 GMT Subject: Re: [PATCHv2] attr: convert to new threadsafe API Message-ID: In-Reply-To: <44c554b8-7ac1-047d-59f0-b4d5331ed496@kdbg.org> Johannes Sixt writes: > Sigh. DCLP, the Double Checked Locking Pattern. ... > I suggest you go without it, then measure, and only *then* optimize if > it is a bottleneck. That comes from me in earlier discussion before the patch, namely in , where I wondered if a cheap check outside the lock may be a possible optimization opportunity, as this is a classic singleton that will not be deinitialized, and once the codepath gets exercised, we would be taking the "nothing to do" route 100% of the time.