Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112541 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 15390 invoked from network); 17 Dec 2020 19:51:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Dec 2020 19:51:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E60A918053D for ; Thu, 17 Dec 2020 11:23:23 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 17 Dec 2020 11:23:19 -0800 (PST) Received: by mail-io1-f54.google.com with SMTP id n4so28658951iow.12 for ; Thu, 17 Dec 2020 11:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R6r+LAVMOrYd2OlHpBmZfDMiaUobA04GUXJdDGYB2CA=; b=jpCGK7EtIpjWX97/zcm64XbtQTHkjdDyrT9+t4vGKAgMDDbiZ5l3nsTR3+2DWOGGC9 pdtbly2zok7rhRj0Ce5+INFLIn2RRNbKxcb/jTS5LHelNcaAvMBigcXcNZmI+sUyntZl cO5DW2tN24U7Dgu+9oVAGAwZILxaVrZ/qt3pkNEHAKcGvnjNF8a3HB4JOrjCifLcRHFc gsGay3R9ugvxog52Okd6hqNL3zKAu9GtMW2rg3HoFgL5eZZJNy4NOZGpbeVwlaEKf5Vo 9VwzcR4qyotyb+IqLUQc5PU0WyqQL5rj282708m0l+00Wb96niPBbCmG02fZZ904kB98 0F6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=R6r+LAVMOrYd2OlHpBmZfDMiaUobA04GUXJdDGYB2CA=; b=GpKYioW8NhUBD3h+Ct4xDtzBK54EFHckROpN+f2IO6DO/Br+8yJQcyV8l4QjDzcJ9t uka7160joPx6TWu68O41P2s0nG9T4tXnDYmfHzc2I8A71qv8RgCU+T9mEhiUPrL76f/f WxjRxDHjF16DXFwYwPcBeEj36GFCeLR2bCf9W8JGqtSL75cgMjO20p3vtrnW3R2xT4Pp aG0Qu5jaQ2ul6sN0wlDWOHSmuZ3+J62s9r9NhNammzGYWQtC46TgQL94rId1Y3/JSPdD HFoxKmZmxYwMHpCBCSJE/4llzqeaj8pLdh092dxLQKyeKQZJP2uayuwfq0tgQ4COTQMl JvCQ== X-Gm-Message-State: AOAM5311b66j2iPGVtQ2NskTTcGAGgkLla/VzxlAdYY6ceKQLtfU81mb KyZxK1Pgtw/pMsiD+0jd/Vyc6WnOGQG8Snn3cFwT8z/pTw1HPUt9 X-Google-Smtp-Source: ABdhPJxZABAbPruvfVc3eFlYhnEcZpH6tNw2TYBdf5hg+U8GojxWayO59ec6C1KJPru3ItS/I3qmmcAiPaSTS9V6oPw= X-Received: by 2002:a5d:8c85:: with SMTP id g5mr581074ion.154.1608232999248; Thu, 17 Dec 2020 11:23:19 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 17 Dec 2020 11:23:08 -0800 Message-ID: To: Aaron Piotrowski Cc: php internals Content-Type: multipart/alternative; boundary="000000000000a2ea0c05b6adecaf" Subject: Re: [PHP-DEV] [RFC] Fibers From: sarkedev@gmail.com (Peter Stalman) --000000000000a2ea0c05b6adecaf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Aaron, this is very interesting to me. Can I ask why this approach as opposed to other paradigms like promises, coroutines, etc? You mentioned async/await in the future scope, and I assume most of these patterns can be implemented once there is an underlying functionality. Basically, why fibers instead of x? You also mentioned this isn't really intended to be used directly, but with a library such as AMPHP. IS the expectation that non-blocking I/O functionality like database drivers and file operation be provided by libraries as well? I hope I don't come off as critical, I am merely curious. Thank you for pushing this forward, as async is something PHP has been lacking and should have IMO to compare favourably to other alternatives that do. Regards, Peter. On Thu, Dec 17, 2020 at 8:30 AM Aaron Piotrowski wrote: > Hello everyone! > > I would like to introduce an RFC for adding full-stack fibers to PHP: > https://wiki.php.net/rfc/fibers > > Fibers are primarily used to implement green-threads or coroutines for > asynchronous I/O. Fibers are similar to threads, except fibers exist with= in > a single thread and require cooperative scheduling of the fibers by the > process. Since fibers do not require a full CPU context switch, they are > lightweight and more performant than multi-processing or threading for > awaiting I/O. > > An implementation as an extension is at https://github.com/amphp/ext-fibe= r > > Fibers are a complex feature. The RFC contains many examples and links to > code using fibers to help explain and demonstrate what is possible, howev= er > I=E2=80=99m certain many more questions and concerns will arise. Looking = forward to > feedback and discussion. > > Aaron Piotrowski > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php > > --000000000000a2ea0c05b6adecaf--