> You must use some additional application specific logic to trigger
> semaphore removal. For example you could have a "boss" process that
> collects the exit status of each "worker". When the boss process has an
> exit status for all workers the semaphore can be removed.
>
> Am I getting closer or
On Wed, 3 Jan 2007 06:51:57 +0100
"Wojciech Malota" <[EMAIL PROTECTED]> wrote:
> > How would your code decide when to actually go ahead and remove the
> > semaphore?
> >
> > Are you suggesting that the semaphore simply be removed whenever it
> > is determined to be "unlocked"? Meaning you want to
> How would your code decide when to actually go ahead and remove the
> semaphore?
>
> Are you suggesting that the semaphore simply be removed whenever it
> is determined to be "unlocked"? Meaning you want to call semget() and
> semctl(IPC_RMID) for every single lock/unlock?
I've wrote about it in
On Wed, 3 Jan 2007 01:20:41 +0100
"Wojciech Malota" <[EMAIL PROTECTED]> wrote:
> > So the point is that you cannot remove the semaphore when there are no
> > callers waiting in semop because that is a perfectly valid state.
>
> Yes, but if function which acquires a semaphore is constructed as
>
> So the point is that you cannot remove the semaphore when there are no
> callers waiting in semop because that is a perfectly valid state.
Yes, but if function which acquires a semaphore is constructed as
my_sem_acquire function it will be safe to remove the semaphore when it is
released (if s
On Tue, 2 Jan 2007 20:04:19 +0100
"Wojciech Malota" <[EMAIL PROTECTED]> wrote:
> > I don't understand. If your "FIFO" is some kind of refcount that won't
> > work because the refcount would not be shared by multiple separate
> > PHP processes. You would have to put the refcount in shared memory
>
> I don't understand. If your "FIFO" is some kind of refcount that won't
> work because the refcount would not be shared by multiple separate
> PHP processes. You would have to put the refcount in shared memory
> and even then there's no guarantee that the semaphore will be cleaned
> up properly be
On Tue, 2 Jan 2007 08:35:10 +0100
"Wojciech Malota" <[EMAIL PROTECTED]> wrote:
> It's impossible to correct remove semaphores with sem_remove function
> when I use them to provide execution of concurrent processes.
> When the last process releases the semaphore I should be able to remove
> it. But
It's impossible to correct remove semaphores with sem_remove function
when I use them to provide execution of concurrent processes.
When the last process releases the semaphore I should be able to remove
it. But I don't know if another process haven't acquired the semaphore.
For safety reasons I do