Subj : Re: Where to download a pthread library To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Wed Mar 30 2005 12:33 pm "David Schwartz" writes: > Assume pthreads is supported if you have a 'pthread.h' header. Use > '-pthread' to invoke pthreads. If '-pthread' doesn't work, you have no > portable way to know what flags to use. On SourceForge's MacOS X cc-2.95.2 doesn't recognize -pthread option. Threads seem to work with no additional libraries linked though. What about this: - If there is no pthread.h, don't use pthreads. Otherwise: - Check if -pthread option causes a warning. If no, keep it, otherwise drop it. - Now, try to link a program which uses pthread_create. If not cross-compiling (I don't support cross-compilation yet anyway), try to run it and check whether it returns 0. Use pthreads if this succeeded. Or maybe it's enough to assume that if pthread_create can be found by the linker then it's usable? -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .