Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101820 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3171 invoked from network); 10 Feb 2018 14:49:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Feb 2018 14:49:07 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.162 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.162 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.162] ([81.169.146.162:35065] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/E9-21403-1660F7A5 for ; Sat, 10 Feb 2018 09:49:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1518274143; s=strato-dkim-0002; d=kelunik.com; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:References: In-Reply-To:X-RZG-CLASS-ID:X-RZG-AUTH; bh=JM7Q5I/cwwVReYCfOLoEMAeqa4suksEBJpNTsbRa+7Q=; b=s596EhDsPj9WtgzNyXF2Z1d4T6xK2kDokDVIx1vQzpDnxQ8gAkAxFNkxZS+ghryJI/ AHmGE78jcWuBcVOndImOgan7FDdA1v3qzJvz65znNZCKY5M40KuMEPRnN4u3Pr3Gy+cQ u/TO09OBQqUDa/xcNtdiOallatUm8M6sjsspM53v/6foBGWKdRnf3q7l3bzonINDvuN3 DWfzp/QHy+ml6D4rdGaA2T2kPD1B3Iah3dg+USD7FKVncEJX2EwWiBEdAeWzSZQwyiU2 YvyhIsX5Hhh6P1/gKS9Ep6Gnwmjscic76cwnAKfBE6rPYp1UGmPQB15d9c90WDVEKJ4f WVpQ== X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mlsGbEv0XHBzMIJSS+jKTzde5mDb8Db2nURiuycA== X-RZG-CLASS-ID: mo00 Received: by mail-yw0-f175.google.com with SMTP id m84so7140870ywd.5 for ; Sat, 10 Feb 2018 06:49:02 -0800 (PST) X-Gm-Message-State: APf1xPArLpsj51u+7+9ZfpJ0WO/11RiB6Rex6PlXNIF3BZyZvMyjzRyn KrCigY4F9hFyEhyrNamG2lSbdRVZavUMX8Pl9hw= X-Google-Smtp-Source: AH8x227/sB02eTLd1LeY5l+oHaY8GLf1ZY9RRCM5hOMqU1SbUW2OJEbm5HGwj88VFlsB5kQcFI4EGOwBgDo3XD/P/hA= X-Received: by 10.37.162.105 with SMTP id b96mr4154703ybi.501.1518274142241; Sat, 10 Feb 2018 06:49:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.182.201 with HTTP; Sat, 10 Feb 2018 06:49:01 -0800 (PST) In-Reply-To: References: <76EBF900-3BE8-4B60-9422-880A9754FCC4@lvht.net> <0DDFDACA-6322-461C-9D57-215E8C7D9CD0@trowski.com> Date: Sat, 10 Feb 2018 15:49:01 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Haitao Lv Cc: Aaron Piotrowski , PHP Internals , Dmitry Stogov Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Fiber support (again) From: me@kelunik.com (Niklas Keller) > Hi, all, > > I have updated the RFC https://wiki.php.net/rfc/fiber > > changes list: > > - introduce the `throw(Exception $exceptin)` API > - record issues discussed What about my suggestion of making PHP's main() automatically a Fiber, which avoids Fiber::yield() being used outside of a Fiber, because everything is a Fiber? This would require another continuation mechanism, as nothing has access to the automatically created main()-Fiber otherwise. There would also need to be something that stops the script execution as soon as there's no non-suspended Fiber anymore. Regarding the internal calls: A core dump / segfault in case of Fiber::yield() inside an internal function is unacceptable. It doesn't give the user any clue what's wrong. Instead, an exception could be thrown from Fiber::yield(), which just bubbles up then. Full support for internal functions could be added at a later point then. Regards, Niklas