From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Myers To: egcs@cygnus.com Subject: Re: GCC Date: Fri, 15 May 1998 15:17:00 -0000 Message-id: <355CBF56.687A3B53@cygnus.com> References: <199805122117.XAA01539@ocean.campus.luth.se> <199805150243.TAA10200.cygnus.egcs@rtl.cygnus.com> X-SW-Source: 1998-05/msg00548.html Jim Wilson wrote: > > I have read duscussions on the FreeBSD lists that EGCS have to be compiled > differently to handle threaded and non-threaded compilation, IIRC. > gcc does "gcc" or "gcc -pthread". > > > There is no problem here. EGCS does exactly what you want. Almost. In C++ code, local variable static initializers do not yet have support for locking during the initialization. For example, in void f() { static T t(); } The compiler generates something vaguely like void f__v() // mangled { static T t; // no ctor call here static bool __t__f_v_inited; if (!__t__f_v_inited) { T::__ct(&t); // constructor call __t__f_v_inited = true; } } For a multi-threaded program, this would need a lock or some other accommodation. But gcc-2.8 doesn't have this either. Nathan Myers ncm@cantrip.org