<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>I have declared a <span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 12px; ">GiNaC</span><span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 12px; "><span style="color: #000000">::parser </span></span><span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 12px; ">l_parser</span><span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 12px; "><span style="color: #000000">; in a class method which is called in a multithread.</span></span></div><div><span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 12px; "><span style="color: #000000">If I show valgrind report I see:</span></span></div><div><span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 12px; "><span style="color: #000000"><br></span></span></div><div><span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 12px; "><span style="color: #000000"><div>==1084== Possible data race during write of size 1 at 0x1f06e4 by thread #3</div><div>==1084== at 0x1B30F6: std::string::_Rep::_M_set_length_and_sharable(unsigned long) (in /usr/lib/libstdc++.6.0.4.dylib)</div><div>==1084== by 0x1B39FB: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (in /usr/lib/libstdc++.6.0.4.dylib)</div><div>==1084== by 0x1B3A43: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (in /usr/lib/libstdc++.6.0.4.dylib)</div><div>==1084== by 0x1B3AE7: std::string::assign(char const*, unsigned long) (in /usr/lib/libstdc++.6.0.4.dylib)</div><div>==1084== by 0x115D139: GiNaC::lexer::lexer(std::istream*, std::ostream*, std::ostream*) (in /Developer/opt/Ginac/1.5.8/lib/libginac-1.5.0.dylib)</div><div>==1084== by 0x1157CC2: GiNaC::parser::parser(std::map<std::string, GiNaC::ex, std::less<std::string>, std::allocator<std::pair<std::string const, GiNaC::ex> > > const&, bool, std::map<std::pair<std::string, unsigned long>, GiNaC::ex (*)(std::vector<GiNaC::ex, std::allocator<GiNaC::ex> > const&), std::less<std::pair<std::string, unsigned long> >, std::allocator<std::pair<std::pair<std::string, unsigned long> const, GiNaC::ex (*)(std::vector<GiNaC::ex, std::allocator<GiNaC::ex> > const&)> > > const&) (in /Developer/opt/Ginac/1.5.8/lib/libginac-1.5.0.dylib)</div><div><br></div><div><span id="result_box" class="short_text"><span style="background-color: rgb(255, 255, 255);" title="">When will be ginac thread safe and is there such a thing?</span></span></div><div><span id="result_box" class="short_text"><span style="background-color: rgb(255, 255, 255);" title="">Thx</span></span></div><div><span id="result_box" class="short_text"><span style="background-color: rgb(255, 255, 255);" title=""><br></span></span></div><div><span id="result_box" class="short_text"><span style="background-color: rgb(255, 255, 255);" title="">Phil</span></span></div></span></span></div></body></html>