|
Boost : |
Subject: Re: [boost] [thread] static thread_specific_ptr?
From: JoãÂo Abecasis (jpabecasis_at_[hidden])
Date: 2009-03-01 06:19:09
Roland Schwarz wrote:
> Does this mean you have solved the initialization problem for
> local statics? i.e. you made this thread-safe for every compiler?
>
> (I remeber a very nasty bug in spirit because of the cited pattern.)
This was fixed in Spirit by solving the said problem. You can find the
solution here:
<boost/spirit/home/classic/core/non_terminal/impl/static.hpp>
http://tinyurl.com/byve27
with usage illustrated here, around line 238 (look for
get_definition_static_data_tag):
<boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp>
http://tinyurl.com/cbnuca
Admittedly it can be cumbersome, but it works.
A performance hit has been reported for repeatedly callling call_once,
that can be solved with double-checked locking. This is not implemented
in the repository version.
Cheers,
João
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk