I have the following code snippet
void* t_function (void* arg)
fprintf (stdout, “child-> thread pid is %d\n”, (int) getpid ());
int main ()
fprintf (stdout , “main-> thread pid is %d\n”, (int) getpid ());
pthread_create (&thread_id, NULL, &t_function, NULL);
Here main, and child thread both prints the pid same value. How is that possible ?. As for as i know
in linux, a thread is as like as individual process, but only shares the process address space?.
I m trying to run in ubuntu linux kernel 2.6. Any suggessions ??