Re: [PHP-DEV] Optional nowait argument to sem_acquire

[email protected] ("[email protected]")
Newsgroups php.internals
Message-ID <CAFp73Xv8HHo1A0cEhXku_T1fu=ApTz4fFNGRACfL5daObjU38w@mail.gmail.com>
Hi Matteo,

BSD does accept it as sem_timedwait, which I could find a reference for
FreeBSD:

http://www.freebsd.org/cgi/man.cgi?query=sema&sektion=9

Cheers,


On Tue, Sep 2, 2014 at 10:01 AM, Matteo Beccati <[email protected]> wrote:

> Hi,
>
> On 02/09/2014 15:38, [email protected] wrote:
> > I'd propose instead of accepting "nowait" only, I'd use a better support
> > and accept "until", dealing with possible cases:
> >
> >   * -1: Blocks and wait until lock is acquired
> >   * 0: Exactly what your patch does, attempt to grab and if it fails,
> >     just return false (I'd remove the E_WARNING)
>
> (It doesn't. The warning is raised when the semaphore can't be acquired
> for other reasons)
>
> >   * > 0: Acceptable time in milliseconds it would wait until consider
> >     the acquire failed
>
> TBH, I don't know. semtimedop is not universally available (no BSD, as
> far as I can tell) and I would prefer to avoid writing an alternative
> implementation in case it's not available. On the other hand triggering
> an error in such case wouldn't be nice.
>
>
> Cheers
> --
> Matteo Beccati
>
> Development & Consulting - http://www.beccati.com/
>



-- 
Guilherme Blanco
MSN: [email protected]
GTalk: guilhermeblanco
Toronto - ON/Canada
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.