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 */
}
Can I commit this ?
[1] http://arnaud.lb.s3.amazonaws.com/pcntl_signal_dispatch.patch
Regards,
Arnaud
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.
regards,
Derick
--
HEAD before 5_3!: http://tinyurl.com/6d2esb
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org
On Sunday 27 July 2008 16:04:58 Derick Rethans 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
On Sunday 27 July 2008 16:38:47 Arnaud Le Blanc wrote:
On Sunday 27 July 2008 16:04:58 Derick Rethans 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.
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:
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()
andpcntl_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
I added
pcntl_sigwaitinfo()
,pcntl_sigtimedwait()
andpcntl_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).
Could you separate the ticks/dispatch patch from the new functions, please?
I just think they are two separate things and therefore should committed in two steps.
Other than that, I don't have any objections.
--
Wbr,
Antony Dovgal
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).Could you separate the ticks/dispatch patch from the new functions,
please?
I just think they are two separate things and therefore should
committed in two steps.
Other than that, I don't have any objections.
Then go ahead and commit according to the notes by Tony.
We will then keep the deprecation flags as is in HEAD and 5.3.
Could you also update the http://wiki.php.net/doc/scratchpad/upgrade/
53 page?
regards,
Lukas Kahwe Smith
mls@pooteeweet.org
On Tuesday 29 July 2008 16:55:12 Lukas Kahwe Smith wrote:
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).Could you separate the ticks/dispatch patch from the new functions,
please?
I just think they are two separate things and therefore should
committed in two steps.
Other than that, I don't have any objections.Then go ahead and commit according to the notes by Tony.
We will then keep the deprecation flags as is in HEAD and 5.3.
Could you also update the http://wiki.php.net/doc/scratchpad/upgrade/
53 page?regards,
Lukas Kahwe Smith
mls@pooteeweet.org
Thanks :)
Ok for the wiki, I will update it.
On Tuesday 29 July 2008 16:40:03 Antony Dovgal wrote:
I added
pcntl_sigwaitinfo()
,pcntl_sigtimedwait()
andpcntl_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).Could you separate the ticks/dispatch patch from the new functions, please?
I just think they are two separate things and therefore should committed in
two steps.
Other than that, I don't have any objections.--
Wbr,
Antony Dovgal
Yes, no problem, I will commit them separately :)
Could you separate the ticks/dispatch patch from the new functions, please?
I just think they are two separate things and therefore should committed in
two steps.
Other than that, I don't have any objections.
Yes, no problem, I will commit them separately :)
Thanks a lot!
--
Wbr,
Antony Dovgal