Subj : Re: creating library to be used in threaded and nonthreaded apps To : comp.programming.threads From : Ian Date : Fri Apr 29 2005 02:16 pm Chris Friesen wrote: > > I'm writing a shared library that is designed to be reentrant. (No > static data, etc.) It is safe to call from multiple threads > simultaneously. > > I'd like to make one version of the shared library that I can use in > both threaded an nonthreaded applications, without forcing the > nonthreaded apps to link against the pthreads library. > > I *think* I need to do at least something to tell the compiler how to > deal with stuff like errno, but maybe that's implementation-dependent? > If your library is thread safe and doesn't use any thread calls, why would the user require libpthread? The standard runtimes (libC) should take care of these details. Ian .