I have stipped down my test function that I create threads based on. shared is my shared memory element.
Thanks for any help or advice.
void *Test(void *arg)
{
int i;
for ( ; ; )
{
Sem_wait(&shared.nstored);
Sem_wait(&shared.mutex);
i = shared.temp;
shared.temp =...
Hello All,
I am creating a c program that uses Pthreads and posix Semaphores. In my thread I am accessing shared memory and copying the needed data and then executing a given command via System() and putting it to sleep after words. When I do this with one thread it works fine but if I use...
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.