Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39382 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12396 invoked from network); 27 Jul 2008 14:40:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2008 14:40:20 -0000 Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.186 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arnaud.lb@gmail.com X-Host-Fingerprint: 209.85.128.186 fk-out-0910.google.com Received: from [209.85.128.186] ([209.85.128.186:49643] helo=fk-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/57-02589-3D88C884 for ; Sun, 27 Jul 2008 10:40:20 -0400 Received: by fk-out-0910.google.com with SMTP id 18so3016801fks.7 for ; Sun, 27 Jul 2008 07:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=+v+Tn306bCpCKDQTyshQwhWX7xU2v2CAubXfEC7/VPM=; b=QhvASKzLtDjmacZMpiI3Wpx44zuz0FZjC4a55jJY51jWmDdpYjOB/QHY/mYfwaTddk OLsDDCrg179RO08ffVKrXyszYK+LChU5OOWpqnPzV4sNYHOYRhFBnrX0anXc2BLimW1r tODmAxmDmN14PZjI2Bd+yWVc6J71sTcHNBRe4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=Cp5b1BYC/u1KFmBAM+/bs2rl2qFI/xAR3kTZl4YsTJ5nQaCzToBoono0V/opKDm7I2 7Aa+G0nicTOE/JG+mkNoL4hP0hKe8cXI9n5Vq2FqP45aTQQnkN42hNbIRtRNkU/9vEBU ppUWiTsb35Kn8ot/nXv7OuYxV78YRXoEyRQcM= Received: by 10.103.22.11 with SMTP id z11mr2355671mui.106.1217169616834; Sun, 27 Jul 2008 07:40:16 -0700 (PDT) Received: from 207-177-41-213.getmyip.com ( [213.41.177.207]) by mx.google.com with ESMTPS id w5sm81624113mue.11.2008.07.27.07.40.14 (version=SSLv3 cipher=RC4-MD5); Sun, 27 Jul 2008 07:40:15 -0700 (PDT) To: Derick Rethans Date: Sun, 27 Jul 2008 16:38:47 +0200 User-Agent: KMail/1.9.9 Cc: internals@lists.php.net References: <200807271551.30949.arnaud.lb@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200807271638.47548.arnaud.lb@gmail.com> Subject: Re: [PHP-DEV] Replacement to ticks for signals From: arnaud.lb@gmail.com ("Arnaud Le Blanc") On Sunday 27 July 2008 16:04:58 Derick Rethans wrote: > On Sun, 27 Jul 2008, Arnaud Le Blanc wrote: > > > Hi, > > > > I made a pcntl_signal_dispatch() function [1] to allow scripts that use > > signals to work without ticks. > > > > This function just calls the pcntl's tick handler on-demand so that all signal > > handler functions are called if there are pending signals. > > > > It does not allow the signal handlers to be called at any time like with > > ticks, but allows things like this: > > > > while (do_something()) { > > /* main loop */ > > pcntl_signal_dispatch(); > > } > > > > or > > > > while (pcntl_signal_dispatch() && do_something()) { > > /* main loop */ > > } > > Does the function block if there are no pending signals? If not, I think > we should make that an option. > No, but I was thinking to implement sigwaitinfo()/sigtimedwait(), which blocks indefinitly or for a given time until a signal is delivered. This also requires to implement sigprocmask(). It would also be great to have signalfd() (which is select()able), but it's Linux specific and requires quite recent Kernel and libc (that said, I'm going to implement it if there are positive feedbacks about that). Regards, Arnaud