|
Boost : |
Subject: Re: [boost] [Interprocess::Semaphore] Deadlock on more producers - one consumer problem
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-06-20 17:54:40
Zachary Turner wrote:
> Sorry for jumping into the middle of this. But shouldn't it only
> notify_one() if count is greater than or equal to 0? Not
> unconditionally. It's possible to initialize the semaphore with a
> negative count, and in that case a call to wait() should not unblock
> until the semaphore is 0 or higher.
Ummm... Interprocess models POSIX primitives and I see that
#include <semaphore.h>
int sem_init(sem_t *sem, int pshared, unsigned int value);
semaphore value should be always positive, something that does not
happen in Interprocess:
interprocess_semaphore(int initialCount);
So I think I should change interprocess constructor to an unsigned int.
Best,
Ion
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk