<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks Daniel and Oliver, I appreciate it.&nbsp; The static expression is exactly what the problem was.&nbsp; Here's a discussion in case anyone else ever comes across the same problem with the boost.regex example code that uses a static regex:<br><br><a href="http://stackoverflow.com/questions/4590626/c-static-variables-in-multithreaded-program" target="_blank">http://stackoverflow.com/<wbr>questions/4590626/c-static-<wbr>variables-in-multithreaded-<wbr>program</a><br><br><br><br>&gt;From:<br>&gt;"Oliver Seiler" &lt;oseiler@acm.org&gt;<br>&gt;To:<br>&gt;boost-users@lists.boost.org<br>&gt;I've generally found that using function-level static with multiple<br>&gt;threads is a Bad Idea (including with Boost.Threads) as the object<br>&gt;won't get initialized until the function is run for the "first" time,<br>&gt;but this initialization isn't generally
 thread-safe. Consider moving<br>&gt;the static regex out of the function (e.g., into an anonymous<br>&gt;namespace) so that it is initialized at global static initialization<br>&gt;time.<br><br><br>&gt;here few suggestions:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div id="yiv356846089">&nbsp;- What if you put the regex automatic instead of static ?&nbsp;<div>&nbsp; &nbsp;&nbsp;often objects of classes a thread safe when different object are use (they do not share static data), but the &nbsp;same object cannot be used within two thread &nbsp;without some ways to serialize access which must be done by the user of the object.</div>
<div>- if you keep the regex static within the function, at least make the construction thread safe.&nbsp;</div><div><br></div><div><br></div><div>Daniel Anderson</div></div></blockquote></td></tr></table>