[CppAD] pthread_getunique_np

Iakov Nakhimovski Iakov.Nakhimovski at gmail.com
Thu Aug 25 18:13:58 EDT 2011


Hello!

Have you considered using Boost Thread package? You'll get
Linux/Win/Mac covered.

pthread_getunique_np is not portable:
http://publib.boulder.ibm.com/infocenter/aix/v7r1/index.jsp?topic=%2Fcom.ibm.aix.basetechref%2Fdoc%2Fbasetrf1%2Fpthread_getunique_np.htm

Best regards,

Iakov

On Thu, Aug 25, 2011 at 6:11 PM, Brad Bell <bradbell at seanet.com> wrote:
> Should the function
>     #include <pthread.h>
>     int pthread_getunique_np(pthread_t thread, pthread_id_np_t *id);
> be defined for all posix thread systems ?
>
> It is described at
>
> http://cursuri.cs.pub.ro/~apc/2003/resources/pthreads/uguide/users-23.htm
>
> On the other hand, it is not present in
>     http://pubs.opengroup.org/onlinepubs/009695399/basedefs/pthread.h.html
>
> If I run the the bash script included below, I get the response
> $ ./pthread_id.sh
> g++ -g pthread_id.cpp -o pthread_id
> pthread_id.cpp: In function `int main(int, char**)':
> pthread_id.cpp:6: error: `pthread_id_np_t' was not declared in this scope
> pthread_id.cpp:6: error: expected `;' before `tid'
> pthread_id.cpp:7: error: `tid' was not declared in this scope
> pthread_id.cpp:7: error: `pthread_getthreadid_np' was not declared in
> this scope
>
> ----------------------------------------------
> #! /bin/bash -e
> #
> cat << EOF > pthread_id.cpp
> # include <pthread.h>
> # include <cstdlib>
>
> int main (int argc, char *argv[])
> {
>      pthread_id_np_t   tid;
>      tid = pthread_getthreadid_np();
>
>      exit(0);
> }
> EOF
> echo "g++ -g pthread_id.cpp -o pthread_id"
> g++ -g pthread_id.cpp -o pthread_id
> #
> echo "./pthread_id"
> ./pthread_id
>
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad
>




More information about the CppAD mailing list