Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101012 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2967 invoked from network); 1 Nov 2017 09:45:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2017 09:45:24 -0000 Authentication-Results: pb1.pair.com header.from=i@lvht.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=i@lvht.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lvht.net from 54.207.22.56 cause and error) X-PHP-List-Original-Sender: i@lvht.net X-Host-Fingerprint: 54.207.22.56 smtpbgbr2.qq.com Received: from [54.207.22.56] ([54.207.22.56:40465] helo=smtpbgbr2.qq.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/29-07742-2B799F95 for ; Wed, 01 Nov 2017 04:45:23 -0500 X-QQ-mid: bizesmtp8t1509529514t8m7ndd6a Received: from [10.23.164.64] (unknown [222.73.196.18]) by esmtp4.qq.com (ESMTP) with id ; Wed, 01 Nov 2017 17:45:13 +0800 (CST) X-QQ-SSF: 0110000000200050F650B00A0000000 X-QQ-FEAT: zoMYfbkgch00fAc6tEOjtkYE2SGhImLANv+TSNG20QnDFo045ITCwhltDq9RA 0DUROU8QOMqnnkDbVHqmHa7pyLxAbAOlh1Ka4PG949b9P1GDuHdvDEu8fk/3RoMntfFIlUw 1Y+xGFSYdageNJFIIiw9CNhVuyEciyBglCHvkWFqzm8cBIFDtKNAQukpzib0gLavd2wBX4z 84/1z2Tc8d3Ps9H6ciLO/II24dQtEXXwdhrc0qyGuY2OtsdW3ZU/v2l8uCPbMHuC7ZMaGog 3l7ppangRe4daR X-QQ-GoodBg: 0 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) In-Reply-To: <358E7BE8-F3D3-47BC-AD44-21B0A9D4ABA5@lvht.net> Date: Wed, 1 Nov 2017 17:45:13 +0800 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <0C785312-A09B-4E44-A1F2-40964C5AECBF@lvht.net> References: <736B46E8-9458-4E63-8BB7-AF93A8C35F58@lvht.net> <358E7BE8-F3D3-47BC-AD44-21B0A9D4ABA5@lvht.net> To: Dmitry Stogov X-Mailer: Apple Mail (2.3445.4.7) X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:lvht.net:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 Subject: Re: [PHP-DEV] RFC - Zend VM Pause API From: i@lvht.net (Haitao Lv) To make the discussion more detailed, please allow me to offer my = implementation of use land coroutine(Fiber). = https://github.com/php/php-src/compare/master...fiberphp:fiber-ext?expand=3D= 1 > On 1 Nov 2017, at 17:32, Haitao Lv wrote: >=20 > Suppose we have a internal Coroutine class and it has a resume() = method. >=20 > In order to resume the coroutine, we have to call the resume() = function. >=20 > As the resume function is a internal method defined in c, we need call >=20 > zend_execute_ex(backuped_execute_data) >=20 > to resume the zend execution. >=20 > 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. >=20 > However, we will never see the resume() method returned and never get = its return value. >=20 >> On 1 Nov 2017, at 17:14, Dmitry Stogov wrote: >>=20 >> 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). >>=20 >> Thanks. Dmitry. >> From: Haitao Lv >> Sent: Wednesday, November 1, 2017 11:54:54 AM >> To: Dmitry Stogov >> Cc: PHP Internals >> Subject: Re: [PHP-DEV] RFC - Zend VM Pause API=20 >>=20 >> 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. >>=20 >> However, my RFC propose to stop the current execution. >>=20 >>> On 1 Nov 2017, at 16:07, Dmitry Stogov wrote: >>>=20 >>> Hi, >>>=20 >>> 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. >>>=20 >>> Thanks. Dmitry. >>> From: Haitao Lv >>> Sent: Wednesday, November 1, 2017 4:19:07 AM >>> To: PHP Internals >>> Subject: [PHP-DEV] RFC - Zend VM Pause API=20 >>>=20 >>> Hi, internals, >>>=20 >>> I propose to introduce a new zend vm pause api, and here is the RPF >>>=20 >>> https://wiki.php.net/rfc/zend-vm-pause-api >>>=20 >>> Please gave your comment. >>>=20 >>> Thank you. >>>=20 >>>=20 >>>=20 >>> --=20 >>> PHP Internals - PHP Runtime Development Mailing List >>> To unsubscribe, visit: http://www.php.net/unsub.php >>=20 >>=20 >=20 >=20 >=20 >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20