Re: RFC - Zend VM Pause API
| From: | Haitao Lv | Date: | Wed, 01 Nov 2017 09:32:32 +0000 |
| Subject: | Re: RFC - Zend VM Pause API | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101011@lists.php.net to get a copy of this message | ||
Suppose we have a internal Coroutine class and it has a resume() method.
In order to resume the coroutine, we have to call the resume() function.
As the resume function is a internal method defined in c, we need call
zend_execute_ex(backuped_execute_data)
to resume the zend execution.
If we need to pause the coroutine, we set the EG(vm_interrupt) and interrupt_function,
and switch the execute data and stack. The zend vm will execute the old online.
However, we will never see the resume() method returned and never get its return value.
> On 1 Nov 2017, at 17:14, Dmitry Stogov <dmitry@zend.com> wrote:
>
> after zend_interrupt_function() callback VM continues execution using EG(current_execute_data).
> callback may modify it in any way (e.g. unwind stack, or switch to another co-routine or
> continuation).
>
> Thanks. Dmitry.
> From: Haitao Lv <i@lvht.net>
> Sent: Wednesday, November 1, 2017 11:54:54 AM
> To: Dmitry Stogov
> Cc: PHP Internals
> Subject: Re: [PHP-DEV] RFC - Zend VM Pause API
>
> It seems that set EG(vm_interrupt) to 1 could not stop the vm execution but only execute the
> interrupt_function and continue the current execution.
>
> However, my RFC propose to stop the current execution.
>
>> On 1 Nov 2017, at 16:07, Dmitry Stogov <dmitry@zend.com> wrote:
>>
>> Hi,
>>
>> It should be possible do similar things using EG(vm_interrupt) and
>> zend_interrupt_function() callback (introduced in php-7.1)
>> ext/pcntl implements asynchronous signal handling using this.
>>
>> Thanks. Dmitry.
>> From: Haitao Lv <i@lvht.net>
>> Sent: Wednesday, November 1, 2017 4:19:07 AM
>> To: PHP Internals
>> Subject: [PHP-DEV] RFC - Zend VM Pause API
>>
>> Hi, internals,
>>
>> I propose to introduce a new zend vm pause api, and here is the RPF
>>
>> https://wiki.php.net/rfc/zend-vm-pause-api
>>
>> Please gave your comment.
>>
>> Thank you.
>>
>>
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
>