29e Subj : Re: pthreads with C++ To : comp.lang.c++,comp.programming.threads From : Nadina Date : Mon Apr 18 2005 10:49 pm Hi, In order to pass variables to pthreads you can use either -global variables, either the -void* arg parameter of function int pthread_create(pthread_t *tid, const pthread_attr_t *attr, void *(*funct)(void*), void *arg); Now with global variables, they are visible to all the threads and you would need to lock them as each individual thread accesses the glob variable (if M is modified). With the (void* arg) you do not need to worry about locking. Embeding M into a void * is as simple as: (void *) &M Nadina . 0