Unix Programming - semop() and EINTR when releasing (incrementing) a semaphore

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > June 2004 > semop() and EINTR when releasing (incrementing) a semaphore





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author semop() and EINTR when releasing (incrementing) a semaphore
Michael Corcoran

2004-06-15, 5:56 pm

Hello,

I am experiencing a strange deadlocking problem with a program I'm working
on. It is a large and complex multi-process/multi-threaded application. I
am specifically trying to resolve this problem on the Solaris 9/Intel
platform.

Every once in a while (usually after days of running fine), the application
deadlocks on a semaphore. I cannot find anywhere that I am NOT properly
releasing the semaphore after obtaining it, or any other cause to deadlock.
But, the state that it is left in when it is deadlocked suggested that, in
fact, a semaphore wasn't released at some point. The problem may be any
number of other situations, but one hunch that I had was that semop() was
exiting with EINTR while attempting to increment (release) a semaphore....is
this possible??? I was accounting for the possibility of EINTR being
returned while attempting to obtain a semaphore because the thread/process
may be blocked and in a wait state, but I haven't been accounting for the
possibility of EINTR being returned while releasing a semaphore.

Thanks for any help.

-Mike C.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com