On Jan 17, 10:34 pm, arahne <[EMAIL PROTECTED]> wrote: > Viatly wrote: > > I 'd like to know whether single-threaded gcc can be used for: > > 1. Writing multithreaded C app ( gcc file.c -pthread ). > > 2. Writing multithreaded C++ app ( g++ file.cpp -pthread ). > > Short answer: YES.
However the fact that gcc is single-threaded means that gcc was build with --enable-threads option off; this option enables C++ exception handling for multi-threaded code. Does it mean that I should not use exceptions in C++ code? But even if I don't myself, some parts of the standard library could do it, e.g. new() throws bad_alloc. Also, how could you comment this: [citation] 4. All C++ code compiled by gcc 3.X configured with --disable-threads. The final program is actually multi-threaded. Undetectably broken. It might work, or it might not, on any particular run. The most basic problem is that C++ exception handling will not work properly. Up the stack from there, standard C++ library resources might get trashed. [/citation] Citated from http://gcc.gnu.org/ml/libstdc++/2001-10/msg00024.html _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus