From: Mark R. <mi...@ma...> - 2009-02-15 13:55:03
|
Dear List! The subject of thread safety in mingw-gcc copiled code using exceptions has been brought up many times over the last few years. It has occasionally been described how to compile mingw to work correctly. One question though remains unanswered: Was there ever a _release_ of mingw that produced correct output for multi-threaded exception-infested code? I have tested two versions (version 5.1.4, containing gcc 3.4.5 (20060117), and a version bundled with Dev-Cpp containing I think gcc 3.4.2) and found both to produce code that crashes ("Abnormal Program Termination") when code like this { throw 3; catch (int) { } } is executed while more than one thread is running. (OK: Sometimes it doesn't crash until there are more than two threads running, but that's probably a timing issue.) My test program uses glibmm to launch the threads. It was compiled with gcc.exe -Wall -mthreads -o main.exe main.cpp -l... -L... -I... Options -o3 and -g make no differnence. My Windows is Windows Professional 2000 with the latest Service Packs installed. Have a good Sunday, Mark |