Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101011 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1194 invoked from network); 1 Nov 2017 09:32:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2017 09:32:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=i@lvht.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=i@lvht.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lvht.net from 54.206.34.216 cause and error) X-PHP-List-Original-Sender: i@lvht.net X-Host-Fingerprint: 54.206.34.216 smtpbgau2.qq.com Received: from [54.206.34.216] ([54.206.34.216:34293] helo=smtpbgau2.qq.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/C8-07742-CB499F95 for ; Wed, 01 Nov 2017 04:32:46 -0500 X-QQ-mid: bizesmtp14t1509528754tx039iok Received: from [10.23.164.64] (unknown [222.73.196.18]) by esmtp4.qq.com (ESMTP) with id ; Wed, 01 Nov 2017 17:32:33 +0800 (CST) X-QQ-SSF: 0110000000200050F550B00A0000000 X-QQ-FEAT: 1RpXLlb/fsZEEJaUeKzCgAUB+O29Vahsa5CZ5M9uQEndGXrhQn4JGx2pGU39O TfhuZ3Ku8SKZijGHkfdAFHkybUXvnfM068qmTO5jAPQGV+wXfTzIzgnpRqGRqhpfrIhcgvb L75SL5Idx+MXGYWegIQf9FvgIUSFD+gCA5nkG39fITAs892uLXnn2s1ouOe4qujfv6DCUPo Z7cY1ZWkz/+9fmmOH8L8ulpx7Q9A6654G8qjYLPFQ1ykBjoX+37Q4T9rtiz0d6KCy1HDAo/ t78/HT64AqrLzZ 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: Date: Wed, 1 Nov 2017 17:32:32 +0800 Cc: PHP Internals Content-Transfer-Encoding: quoted-printable Message-ID: <358E7BE8-F3D3-47BC-AD44-21B0A9D4ABA5@lvht.net> References: <736B46E8-9458-4E63-8BB7-AF93A8C35F58@lvht.net> To: Dmitry Stogov X-Mailer: Apple Mail (2.3445.4.7) X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:lvht.net:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 Subject: Re: [PHP-DEV] RFC - Zend VM Pause API From: i@lvht.net (Haitao Lv) 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 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