Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39435 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12603 invoked from network); 29 Jul 2008 14:30:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jul 2008 14:30:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.46.28 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: 74.125.46.28 yw-out-2324.google.com Received: from [74.125.46.28] ([74.125.46.28:15541] helo=yw-out-2324.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/88-24886-9692F884 for ; Tue, 29 Jul 2008 10:30:03 -0400 Received: by yw-out-2324.google.com with SMTP id 5so1439516ywb.83 for ; Tue, 29 Jul 2008 07:29:58 -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=/LYwMhxfDb06AWXVcdhyetgtwJw1NIPmEcUGX1b9BAs=; b=Z2pItB91c6M4KaNIWkv7VVvSlulJ5zZk/f8siAmH5bxXr3e62F+4B97mchuR6NKALX 6Y28oKw5BfTew6Mtx/nwdUeWTJn9vy4gcnCJ8asvCpv76caK4JivxNCIG/ymbsWAqimi iAL87CzEMN5vltqZFyVyJcEh7J0YApmjICCLY= 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=nJ71CuDU19AoJDFOd3utZVX4MYtfARNc6EXl2CLbXge7wE8zlaV+yZvH/m896sxTCA YmAPzUJVfP5a7HN89J35GYu2O8be0qXBXlaeqj7XY6OWzyOxZrujaujyQS15H6QaDnNR 4dNsrHRWJHUcebizFYfqHU7QT5XqMawGrqf6o= Received: by 10.114.177.1 with SMTP id z1mr6614663wae.226.1217341797870; Tue, 29 Jul 2008 07:29:57 -0700 (PDT) Received: from 207-177-41-213.getmyip.com ( [213.41.177.207]) by mx.google.com with ESMTPS id j63sm19788678rne.9.2008.07.29.07.29.54 (version=SSLv3 cipher=RC4-MD5); Tue, 29 Jul 2008 07:29:56 -0700 (PDT) To: internals@lists.php.net Date: Tue, 29 Jul 2008 16:28:22 +0200 User-Agent: KMail/1.9.9 Cc: Lukas Kahwe Smith , Johannes =?utf-8?q?Schl=C3=BCter?= , Derick Rethans References: <200807271551.30949.arnaud.lb@gmail.com> <200807271638.47548.arnaud.lb@gmail.com> <200807281726.40115.arnaud.lb@gmail.com> In-Reply-To: <200807281726.40115.arnaud.lb@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200807291628.22889.arnaud.lb@gmail.com> Subject: Re: [PHP-DEV] Replacement to ticks for signals From: arnaud.lb@gmail.com ("Arnaud Le Blanc") On Monday 28 July 2008 17:26:39 Arnaud Le Blanc wrote: > On Sunday 27 July 2008 16:38:47 Arnaud Le Blanc wrote: > > 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). > > > > I added pcntl_sigwaitinfo(), pcntl_sigtimedwait() and pcntl_sigprocmask() to > my patch: > > http://arnaud.lb.s3.amazonaws.com/pcntl.patch > > pcntl_sigwaitinfo() allows to block until the specified signals have been > delivered. > pcntl_sigtimedwait() does the same thing, but with a timeout. > pcntl_sigprocmask() allows to block a set of signals so that they will not be > delivered between two calls of the above functions. Lukas, Johannes, can I ? (As this is to give an alternative to a deprecated feature). Regards, Arnaud