0 Replies Latest reply on Mar 1, 2010 10:02 AM by 807559

    semaphore problem on Solaris

      I am using system V semaphore as named mutex on Solaris platform, I used semop to decrease count of semaphore when trying to lock. however, sometimes it takes very long (several minutes) to lock. it's very hard to reproduce the situation, it just happens occasionally. anyone has running into the same problem before? is it a bug? Thanks.

      My code to lock is as below. and The Solaris version I used is SunOS 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-V250 Solaris
        struct sembuf op;
        op.sem_num = 0;
        op.sem_op  = -1;
        op.sem_flg = SEM_UNDO;
        int err;
             err = semop(_semid, &op, 1);
        while (err && errno == EINTR);