This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More on memory barriers


On Wed, 15 Sep 2004 13:35:59 -0500, Benjamin Kosnik <bkoz@redhat.com> wrote:

> I would have thought that the Double Checked Lock would be written much
> like the code you posted Jason. This idiom is appearing more and more
> often in libstdc++  (currently sans the mb parts!) so I would very much
> like to achieve consensus on the right way to do this.

The general consensus seems to be "Don't".

Unfortunately, ABI issues make it very difficult to use something
preexisting like pthread_once for static local initialization, but I would
strongly advise you to reconsider any other uses of DCLP in libstdc++.
Instead, you should be able to just use a static local variable, once these
issues are worked out.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]