Hi, 
  I have one process creating several threads, inside each thread, I made
getpid() call, 
it should display the same process id, but I got different number. 
  Why? 
  Thanks.

  
----
void main(int argc, char *argv[])
{
        ....
        for (i=0; i<threads; i++)
        {
          pthread_create(&t[i], &attr, rtf_thread, &i_thread[i])
        }

        for (i=0; i<threads; i++)
        {       
           pthread_join(t[i], 0);
        }
        ...
}

void* rtf_thread(void* ptr) {
   
  printf("pid = %d, threadid = %d\n", getpid(), pthread_self());
  ...
  ...

}



_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to