Well then umm what am i supposed to do to make this program work in the way i want? I really tried tons of combinations even read about all of the tutorials about the pthreads (oh and the tutorials also does not work correctly)
I want to printout the value of timer every 100millisecond by using...
ok i have tried the mutexes in this way :
void *tickThread(void *null)
{
for (;;)
{
if ((timer % 100) == 1)
{
pthread_mutex_lock(&mutex);
Sleep(5);
printf("\n in tickThread and in if and Timer is : %u",timer);
pthread_mutex_unlock(&mutex);
}
}
return (void*)0;
}
void...
I need some help in using pthreads (win32 version) with vc++.
I have written some simple code to test the accuracy of pthreads in means of clock times or ticks then tried some combinations of sleep() function to make my program work in synch within the threads but nope it did not work or it...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.