Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Compile a cross-server UNIX FTP program' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Compile a cross-server UNIX FTP program
Authored by: mzs on Apr 20, '04 11:46:09AM
There's a little problem, however, compiling it on OS X, because it uses the pthreads library. On OS X we don't use it, because threads are already built into the Darwin kernel, so you should edit the Makefile and remove the reference to the pthreads lib.

I just wanted to clarify this so people do not get confused. Yes Darwin is multithreaded (inherently so in fact because it is based on Mach) but this has nothing to do with the -pthread option really. Darwin is the kernel though not a user-level thread library. In fact the earliest version of MacOS X server did not even have a pthreads library, you were supposed to use the old cthreads library or mach threads directly! The -pthread option to the compiler toolchain is a common thing on some systems. What it does is it tells the compiler driver to use the appropriate options/libraries/macro definitions to compile/link/preprocess multithreaded code linked with pthreads. On MacOS X the pthreads library is part of the system library automatically linked with all applications and everything has been precompiled in an MT-safe manner, so there is no need for any special options for using pthreads. You can verify this yourself, there is a /usr/lib/libpthread.dylib symlink so that you can link with -lpthread (as you probably should) and it points to libSystem.dylib which is like libc plus a whole bunch of other libraries all in one.

[ Reply to This | # ]