Re: semaphore release before acquire warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 2, 2011 at 2:57 PM, Jeremy Greene <jeremy@xxxxxxxxxx> wrote:

> Hi,
>
>
>
> I am getting a warning when calling sem_release() before (the same php
> script) calls sem_acquire(). I am doing this because it's a "signal" to
> another process. The other process (which happens to be C program) has
> done, or will do, a semop() to acquire the semaphore/signal. The actual
> data transfer is through shared memory.
>
>
>
> It does all functionally work quite nicely, but given that I'm getting
> the warning and that there doesn't seem to be any discussion of this at
> least in this list's archive maybe I'm putting a square peg into a round
> hole... or at least there's a rounder peg available.
>
>
>
> I did look into disabling the warning, but that got me more concerned
> since it seemed like a frowned upon thing to do and even more of a
> performance hit.
>
>
>
> The irony is that I'm using shared memory (and signals) exactly for
> performance reasons L


perhaps try pcntl_signal() to signal the c program rather than
sem_release().

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux