[NTLUG:Discuss] How to use threads
Cameron
hrothgar at endor.hsutx.edu
Mon Aug 7 14:20:45 CDT 2000
* chsubram at nortelnetworks.com [2000.08.07 10:53]:
: To write POSIX compatible threads in RH Linux 6.2 is there any package that
: I need to install ? I get Linker Errors with a simple program that creates a
: thread using the pthread_create() interface.
i suspect you are forgetting to compile with the libs. here's an
example compile line to use pthreads:
gcc -D_REENTRANT -o myprogram myprogram.c -lpthread -ldl
i *think* that will work. you may not need the dl lib ("-ldl"). i
first learned how to use pthreads from an article in the Linux Journal.
i wrote a small program that uses pthreads (and PAM) if you want to see
an example implementation. it's available at
http://unbeatenpath.com/software/away/.
--
cameron
[ I have an inferiority complex. But it's not a very good one. ]
More information about the Discuss
mailing list