ThinkILostMyHead
Programmer
- Nov 12, 2007
- 3
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 more than one thread I get this error "sem_wait error: Interrupted system call". If I remove the system() and Sleep() and I do not recive this error and I can tell that I am getting the correct data from the shared memory. FYI I am using Semaphores to protect shared memory and to ensure there is data to read.
I guess my question is what causes this type of error and how to prevent it?
Please Help!
Thanks
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 more than one thread I get this error "sem_wait error: Interrupted system call". If I remove the system() and Sleep() and I do not recive this error and I can tell that I am getting the correct data from the shared memory. FYI I am using Semaphores to protect shared memory and to ensure there is data to read.
I guess my question is what causes this type of error and how to prevent it?
Please Help!
Thanks