[PR][php-src][#1173][master] - Safe timeout interrupt handling (max_execution_time).
| From: | noreply@php.net | Date: | Wed, 11 Mar 2015 21:24:25 +0000 |
| Subject: | [PR][php-src][#1173][master] - Safe timeout interrupt handling (max_execution_time). | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-2723@lists.php.net to get a copy of this message | ||
You can view the Pull Request on github:
https://github.com/php/php-src/pull/1173
Pull Request Description:
Instread of throwing zend_error() from signal handler, now we just set EG(vm_interrupt) and
EG(timed_out) flags. PHP VM checks EG(vm_interrupt) flag on each JMPx instruction (potential loop
iteration) and then throws the same zend_error() from VM context. This is safe, and we don't
need to wrap some critical code sections with
HANDLE_BLOCK_INTERRUPTIONS/HANDLE_UNBLOCK_INTERRUPTIONS anymore (we will need them only in opcache).
A small overhead of checking EG(vm_interrupt) on jumps is counterbalnaced by improvement from
HANDLE_BLOCK_INTERRUPTIONS/HANDLE_UNBLOCK_INTERRUPTIONS removal.
This mechanism is similar to timeout interrupt handling on Windows, but more efficient.
It doesn't allow interruption of internal functions.
In the future EG(vm_interrupt) may be reused for different purposes.