ext/pcntl asynchronous sugnal handling

php.internals

Dmitry Stogov

10 years ago
Hi, Currently OS signals may be handled through ext/pcntl: - synchronously, calling pcntl_signal_dispatch() manually - asynchronously, if PHP scripts compiled with declare(ticks=N); The simple patch uses the recently added into Zend Engine ability and allows asynchronous signal handling without extra ZEND_TICKs (without any run-time overhead). https://gist.github.com/dstogov/01d1002c1785f82eaac4b937ccaf418f Accepting this would probably need RFC. Thanks. Dmitry.

Nikita Popov

10 years ago
On Thu, Jun 23, 2016 at 2:19 PM, Dmitry Stogov <dmitry@zend.com> wrote:
> Hi, > > > Currently OS signals may be handled through ext/pcntl: > > - synchronously, calling pcntl_signal_dispatch() manually > > - asynchronously, if PHP scripts compiled with declare(ticks=N); > > > The simple patch uses the recently added into Zend Engine ability and > allows asynchronous signal handling without extra ZEND_TICKs (without any > run-time overhead). > > > https://gist.github.com/dstogov/01d1002c1785f82eaac4b937ccaf418f > > > Accepting this would probably need RFC. >
Line 43 should probably call orig_interrupt_function. I'm +10 on this change. Using ticks for interrupt handling was horrible, and since PHP 7 doesn't really work anyway. Nikita

Michael Wallner

10 years ago
> On 23 06 2016, at 14:28, Nikita Popov <nikita.ppv@gmail.com> wrote: > > On Thu, Jun 23, 2016 at 2:19 PM, Dmitry Stogov <dmitry@zend.com> wrote: > >> >> The simple patch uses the recently added into Zend Engine ability and >> allows asynchronous signal handling without extra ZEND_TICKs (without any >> run-time overhead). >> >> >> https://gist.github.com/dstogov/01d1002c1785f82eaac4b937ccaf418f >> >> >> Accepting this would probably need RFC. >> > > Line 43 should probably call orig_interrupt_function. > > I'm +10 on this change. Using ticks for interrupt handling was horrible, > and since PHP 7 doesn't really work anyway. >
Another +10 here!