
Tod Courtney wrote:
I believe the problem is related to this code, which uses a istringstream to convert a string to a basic type (say a double):
template <typename T> bool FromString(T &t,const std::string &s, std::ios_base &(*f)(std::ios_base &)=std::dec) { std::istringstream iss(s); return !(iss >> f >> t).fail(); }
Somewhat off-topic, but couldn't you maybe use boost::lexical_cast to do this?
1) Is there a multi-thread bug in the MinGW implementation istringstream?
If there is, I wouldn't call it a bug. The standard library makes no guarantees about thread safety. For all you know a std::string implementation could internally reference-count its buffers in a non-thread-safe way.
// wait until all threads to end for(int n=0;n
join(); delete worker[n]; delete vec[n]; }
Does moving the two delete calls outside of this loop so that no deletes happen until all threads have finished fix the problem? If so, you might consider using boost::ptr_vector to eliminate the explicit deletes and simplify some of the allocation code.