Re: POSIX thread question
- From: "David Schwartz" <davids@xxxxxxxxxxxxx>
- Date: 29 Aug 2006 19:38:23 -0700
Jack wrote:
I tried the following command, it works:
gcc -pthread -o threadapp threadapp.c
My book suggests the following:
gcc -pthread threadapp.c -o threadapp -lpthread
What is the different? Which on is better?
The first is better. The first will work whether or not there happens
to be a library called 'libpthread' that is needed for POSIX pthreads.
The second may fail or do the wrong thing if such a library does not
exist, is not needed, or does the wrong thing.
DS
.
- References:
- POSIX thread question
- From: Jack
- Re: POSIX thread question
- From: Mikko Rauhala
- Re: POSIX thread question
- From: Michael Rasmussen
- Re: POSIX thread question
- From: David Schwartz
- Re: POSIX thread question
- From: Jack
- POSIX thread question
- Prev by Date: Data sharing in POSIX thread?
- Next by Date: Re: Data sharing in POSIX thread?
- Previous by thread: Re: POSIX thread question
- Next by thread: Re: POSIX thread question
- Index(es):
Relevant Pages
|