Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77038 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92982 invoked from network); 2 Sep 2014 14:01:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2014 14:01:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@beccati.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=php@beccati.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain beccati.com designates 176.9.114.167 as permitted sender) X-PHP-List-Original-Sender: php@beccati.com X-Host-Fingerprint: 176.9.114.167 spritz.beccati.com Received: from [176.9.114.167] ([176.9.114.167:53424] helo=mail.beccati.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/81-18348-9ADC5045 for ; Tue, 02 Sep 2014 10:01:16 -0400 Received: (qmail 16739 invoked from network); 2 Sep 2014 14:01:09 -0000 Received: from home.beccati.com (HELO ?192.168.1.202?) (88.149.176.119) by mail.beccati.com with SMTP; 2 Sep 2014 14:01:09 -0000 Message-ID: <5405CDA0.8010401@beccati.com> Date: Tue, 02 Sep 2014 16:01:04 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: "guilhermeblanco@gmail.com" CC: PHP internals References: <5405BD15.2070602@beccati.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Optional nowait argument to sem_acquire From: php@beccati.com (Matteo Beccati) Hi, On 02/09/2014 15:38, guilhermeblanco@gmail.com 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/