note 115984 added to function.pcntl-signal
| From: | dorogikh dot alexander at gmail dot com | Date: | Wed, 22 Oct 2014 19:40:12 +0000 |
| Subject: | note 115984 added to function.pcntl-signal | ||
| Groups: | php.notes php.notes | ||
| Request: | Send a blank email to php-notes+get-200716@lists.php.net to get a copy of this message | ||
Looks like php uses RealTime signals. This means that if one signal is currently processed, then
other signals will not be lost.
just for example
<?php
pcntl_signal(SIGHUP, SIG_IGN)
?>
in strace log looks like this
"rt_sigaction(SIGHUP, {SIG_IGN, [], SA_RESTORER|SA_RESTART, 0x7f8caf83cc30}, {SIG_DFL, [], 0},
8) = 0"
And code for testing
<?php
pcntl_signal(SIGHUP, function($signo){
echo "1\n";
sleep(2);
echo "2\n";
});
while(true){
sleep(1);
pcntl_signal_dispatch();
}
?>
Run this and send how many SIGHUP signals as you want. All of them will be processed.
P.S.
I guess "all of them". I couldn't found real signal queue size. Will appreciate if
someone points me.
----
Server IP: 72.52.91.14
Probable Submitter: 89.200.254.161
----
Manual Page -- http://php.net/manual/en/function.pcntl-signal.php
Edit -- https://master.php.net/note/edit/115984
Del: integrated -- https://master.php.net/note/delete/115984/integrated
Del: useless -- https://master.php.net/note/delete/115984/useless
Del: bad code -- https://master.php.net/note/delete/115984/bad+code
Del: spam -- https://master.php.net/note/delete/115984/spam
Del: non-english -- https://master.php.net/note/delete/115984/non-english
Del: in docs -- https://master.php.net/note/delete/115984/in+docs
Del: other reasons-- https://master.php.net/note/delete/115984
Reject -- https://master.php.net/note/reject/115984
Search -- https://master.php.net/manage/user-notes.php