-
to write threads
hi all
i have a doubt.
i wrote a program using threads.
i used threads like this
Code:
void one()
{
pthread_t thread;
gint iret1;
iret1=pthread_create( &thread, NULL, two, NULL);
}
void two()
{
printf("enterd in to thread \n");
three();
pthread_exit(0);
}
void three()
{
printf("hiiiiiiii \n");
}
can you tell is this wright way to use threads.
help me thank you in advance
-
Well, this certainly produces a result but maybe not what intend to do. You might look again at the definition of a thread and first reason if you really really really NEED a thread and how the problem can be solved by several threads running in parallel.