[llvm-commits] [llvm] r116426 - /llvm/trunk/include/llvm/PassSupport.h

Howard Hinnant hhinnant at apple.com
Thu Oct 14 10:52:46 PDT 2010


On Oct 14, 2010, at 1:34 PM, John McCall wrote:

> On Oct 14, 2010, at 10:30 AM, Owen Anderson wrote:
>> On Oct 14, 2010, at 1:25 AM, John McCall wrote:
>>> While I agree with Sebastian, I wonder if we care.  Is there any good
>>> reason to not just require the user to ensure that pass initialization
>>> is thread-safe?  "Don't try to concurrently initialize the standard pass
>>> registry" does not seem like an unreasonable constraint.
>> 
>> The problem is that we're trying to do lazy implicit initialization, hidden in the pass constructors.  It's not unreasonable for users to be instantiating passes on different threads.
> 
> Ah, okay.  In that case, we definitely can't portably rely on thread-safe statics.

I'm butting into a conversation without knowing sufficient background.  So I'm just giving information, and not giving an opinion, on the off chance the information is both unknown and helpful:

C++0X has thread safe static initialization and my best estimate is that the 'X' is B.  I.e. I expect C++11 to be voted out in 23 weeks and 2 days from today.

Disclaimer:  predictions of the future are never risk free, and this doesn't mean thread safe static initialization is now portable.  It just means things are likely to trend that way rather quickly.

Could I interest anyone in pthread_once, or std::call_once? :-)

-Howard





More information about the llvm-commits mailing list