On Thu, 2008-01-24 at 09:11 -0800, David Schwartz wrote: > > > Really? So 'errno' refers to a process global in both cases?! > > > (Note that I > > > said the "definition", not the implementation.) > > > Maybe we didn't understand each other - I don't say, that glibc without > > multithread support and with it is the same. I say that linking single > > threaded library which is simply reentrant but doesn't use any locking > > itself to a multithreaded app is 100% safe thing to do. > > I think you are confusing two different definitions of "single threaded". > You may mean by "single threaded" that no threading functions are ever > called. This is a source code issue. The source either calls threading > functions or it doesn't. > > But what the OP and I mean by single threaded is *compiled* single threaded. > That is, without specifying whatever options the compiler wants to make code > multi threaded.
I know that other operating systems/compilers/C runtime libraries are different. And in fact I don't know in what environment Paul Sheer's application will be running, but as I wrote above on current gcc+glibc as used by most widespread Linux distributions there are no extra options which are needed if you want to make code multithreaded. The glibc's are always compiled to be threadsafe (with locking stubs in place) which are replaced with real locking code when libpthread is linked in. So gcc threadedapp.c -o threadedapp -lpthread is everything what is needed to compile and link multithreaded executable. Again, I know that the situation with other compilers/libcs/OSes can be and is very different. -- Tomas Mraz No matter how far down the wrong road you've gone, turn back. Turkish proverb ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager [EMAIL PROTECTED]