Re: -D_REENTRANT



On Thu, Mar 14, 2002 at 03:10:29PM +0100, Sven Neumann wrote:
> Hi,
> 
> I noticed that only glib and atk are compiled with -D_REENTRANT. Pango
> and GTK+ lack this compiler flag and thus do the wrong thing in 
> threaded environments. This doesn't seem to be a problem with glibc
> which redefines some symbols if an application is linked against 
> libpthread but it leads to strange errors with libc implementations
> that don't have this behaviour.

I do not know what compiler you use but the compiler I use do not like
threading options set by the user. To be threadsafe one should use either
special compiler version or an appropriate threading switich

gcc: -pthread option
Sun Forte: -mt option
DEC C/CXX:
	- dce threads: use -threads option
	- posix (d7) threads: use -pthread option
IBM xlc/xlC family
	- no threads: use xlc or xlC compiler
	- dce threads: use xlc_r4 or xlC_r4
	- posix (d7) threads: use xlc_r or / xlC_r

After Sun Forte / IBM xlc / DEC Manuals threading is the busines of the
compiler. So dirctly defining threading features as _REENTRANT or linking thread
or c libraries like -lc_r or -lpthread is not allowed and can cause serioius
problems.

Regards,
		Miroslaw
-- 
Miroslaw Dobrzanski-Neumann

MOSAIC SOFTWARE AG
Base Development and Research
Tel +49-2225-882-291
Fax +49-2225-882-201
E-mail: mne mosaic-ag com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]