<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I try to use a&nbsp;<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">::</span></span><span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 12px; ">symtab</span><span class="Apple-style-span" style="color: rgb(63, 110, 116); font-family: Monaco; font-size: 12px; "><span style="color: #000000">&nbsp;in a thread object. I copy a const reference to the threaded method and get problems on reading the symbols.</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 take a symbol from the table with&nbsp;</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 12px; "><span style="color: #3f6e74">GiNaC</span>::ex x = m_symbols["mysymbol"], I would run on &gt; 1 thread into errors. Valgrind shows this information:</span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 12px; "><br></span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 12px; "><div>Possible data race during write of size 4 at 0x1ea5c04 by thread #1</div><div><br></div><div>==38631== &nbsp; &nbsp;at 0x8137: std::_Rb_tree&lt;std::string, std::pair&lt;std::string const, GiNaC::ex&gt;, std::_Select1st&lt;std::pair&lt;std::string const, GiNaC::ex&gt; &gt;, std::less&lt;std::string&gt;, std::allocator&lt;std::pair&lt;std::string const, GiNaC::ex&gt; &gt; &gt;::_M_erase(std::_Rb_tree_node&lt;std::pair&lt;std::string const, GiNaC::ex&gt; &gt;*) (in main)</div><div><br></div><div>==38631== &nbsp; &nbsp;by 0x92BF: boost::_bi::storage1&lt;boost::_bi::value&lt;worker&lt;double, 2ul&gt; &gt; &gt;::~storage1() (in main)</div><div><br></div><div>==38631== &nbsp; &nbsp;by 0xE0B0: boost::thread* boost::thread_group::create_thread&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, worker&lt;double, 2ul&gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;worker&lt;double, 2ul&gt; &gt; &gt; &gt; &gt;(boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, worker&lt;double, 2ul&gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;mworker&lt;double, 2ul&gt; &gt; &gt; &gt;) (in main)</div><div><br></div><div>I have copied the table with&nbsp;</div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); ">std::copy( p_syms.begin(), &nbsp; &nbsp; &nbsp; p_syms.end(), &nbsp; &nbsp; &nbsp; std::inserter(m_symbols, m_symbols.begin()));</span></div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); "><br></span></div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); ">p_syms is the original table and m_symbols should be the copy, but it doesn't work. In my thread object I can use a deep copy of the symbol table, because every thread is independed of the other threads.</span></div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); "><br></span></div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); ">I'm not sure that the problem is a GiNaC problem, but you can give some tips perhaps.</span></div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); "><br></span></div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); ">Thanks</span></div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); "><br></span></div><div><span class="Apple-style-span" style="color: rgb(0, 116, 0); ">Phil</span></div></span></div></body></html>