27 Apr
2009
27 Apr
'09
6:46 p.m.
If boost::lexical_cast were 100% thread safe I would have no need for guarding access to calling it. Igor R mentioned boost::lexical_cast is thread safe because the function has it own local streambuf instance. I need to do more research but my understanding is that this isn't the case. I was led to believe boost::lexical_cast was not thread safe mostly by reading this discussion:
Well, of course it cannot be "more thread-safe" than the underlying c++ std lib. My remark primarily related to the case of MSVC (http://msdn.microsoft.com/en-us/library/c9ceah3b.aspx), but you're right, it's not 100% portable thread-safity.