Hi folks, I have a big issue with the C runtime library used when with -mno-cygwin option of g++: it looks to be non thread safe in the istream implementation.
The simple program below crashes with segmentation fault when compiled in cygwin with option -mno-cygwin while it works perfectly when compiled with MSVC++ 2008. The difference is that the program compiled from cygwin is linked with msvcrt.dll while the one compiled from MSVC is linked with msvcr90.dll and msvcp90.dll. Do you know the difference between the libraries and why mingw32 uses a different one than MSVC? How can I use the same runtime library with gcc/g++ -mno-cygwin? I am using cygwin 1.5 on Windows XP. Frédéric #include <iostream> #include <sstream> #include <boost/thread.hpp> struct Task { void operator()() { for (size_t k=0 ; k<10000 ; ++k) { double x ; std::istringstream is("10.") ; is >> x ; } } } ; int main() { boost::thread_group g_thread ; for (size_t k=0 ; k<10 ; ++k) g_thread.create_thread(Task()) ; g_thread.join_all() ; return 0 ; } -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple