Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126649 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 781C31A00BC for ; Sat, 8 Mar 2025 13:38:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741440963; bh=unSxBeeFj9b+yyBAKDjrbKNwkPGRsnaYZzTlH90HLX4=; h=Date:From:To:In-Reply-To:References:Subject:From; b=is3xIvcQUF/Xv/sKMtpJ4aRIzAvqeUx9EJlV6KvpNkmtj8fj8YWv4kVXt1ReF8nUf O4bUldiKobgYhEDZIMl2BNQz3CdW/fjkA8RkRkFi2QGrBCC7FZshvZ5pjyD2kFdZCG 1VAC8SWlAIFeeKx+5KnFGY6Q0sLspO4EWs+2kjpMAHSNC1oHRe0pp72E+0DMp12aM1 N0M+s+eq5leBTxBCiFLmoWIb0pTodFPx+h6f8wnB4QMosqHfYx+Z50qjCIbRDt9Uet BNwYEL23C8hrQjPgrPl0Yg/jb2IgBpfuBopYO4tGPb1rynLizr/KO3C2amuvNHYdIi a6glyDXM0JAGw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 68ABD1801FD for ; Sat, 8 Mar 2025 13:36:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 8 Mar 2025 13:36:02 +0000 (UTC) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-abbb12bea54so525574466b.0 for ; Sat, 08 Mar 2025 05:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741441115; x=1742045915; darn=lists.php.net; h=mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=nu588dn5PD9eo7RmaRKZc6zlJwfp/LkvXkCRPEL6bBA=; b=JT/sc2Z/mu6Y0KcPE6e8vx/erbQ4c1HOHe6sSSwSOKz37TqrfwObn7Y6t81YbuDqHN 6r8nI6PkMtThfb0JW7bJ+tD5/HLy1LrwlhGYyExqFi5i6hs5TAEizLzWHRpp11sbJJrt LiKf5lnzFx4gK/g2kc/+z4vBEn3tVgq/YZkcOqLduodSc/KsOxBRQiYAhKL4c0Rsjj92 uCWQm6qRjQXVpfYO5vuSrvNQESycVIG8V94nj3r53k05DsUJdmkAqwirEsXMBPFMBIST 43TInJo8nnEalnotdu3iKalMTXpCzEAsB/4zl4X/XVokZA5KTaM6DYwd319opCcTT5Fi xalQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741441115; x=1742045915; h=mime-version:subject:references:in-reply-to:message-id:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nu588dn5PD9eo7RmaRKZc6zlJwfp/LkvXkCRPEL6bBA=; b=TfHGqqXeOl6EwJG82qbBN9GUmazX0fq0e3GPGnbg79P+hr5sJjADbaOoSQDwh7KsUb D2MHf4Ibm5HoghFPf/Ylm/G+15l1UEsna5ZzIilILw4STgXjxWhkI7r+baUxXl1ero3Z v2A7VQiQLE+3BtkPi/eJHZL1dITRSquoZO4jER6g8QM68jaKe1k02aAZx5A5JRKLhcon A+7GYj9yJCMkP/nvcayXDDparrq1h/jbhJB27ZZcoSUbcQr6ZCqXXjvUF3RMGObdhRkz CsBvaYYDYUofNZ/QVu5idHdt/izQb2eiWncp1XD3vGy3BTUjPWmzYWBuxL5WW9isDUb9 Ndog== X-Gm-Message-State: AOJu0YwQ4X63mEaMC94XgvZO+OzBCBRqTdXS30Croy7Y0VovpvJTHLir TL3NI5YMAZE+a0djaMHTIumBYg+dHoTtcW5bEFcWvzUPyr/w4Hvz/OepNw== X-Gm-Gg: ASbGncsvrKbuFEJdUBQGY4xbdM8xohN4mqKLkP7vQNvDcynhmVf5qZ0FFAUshbbprky BjKcplCU1/o8jHDdTwfQR5mlCI+SONXPEH5itA+iwgIdQEq/1jF4OPTkZ44TOtdkGaAj+fnaMvF fp+azTkkwIz3nrgpzy5bA/a5zzQxSwT2Ze60okOYQFFDm2YlSss627QMb4RpTOgy4VJMJN2ZABP yix254SXsEryBe7Sng/3qvROAoA5haELuon1NHViq+Pks6t07QUXc6uHZDLz5qOJfvB7JloU4TZ Cx57rojOqUF6hHgQTHlOHMXZBWFhHXlgSsJFv8mMWxt/ERXlPi2xXQy0gLkI7xKh50kbJm6kK4g m1HVvYSKrwEVb4p5Qx1t9ykQygNRz X-Google-Smtp-Source: AGHT+IH/NyWT+dpN2u7MrTBR39oTSE8lUgydBFhdJBAg9eKpuXzB6iWuUirZ8q9OPD4b1e0sooQ3LQ== X-Received: by 2002:a17:907:9490:b0:ac1:ebfe:fd90 with SMTP id a640c23a62f3a-ac2525980femr865680666b.1.1741441115147; Sat, 08 Mar 2025 05:38:35 -0800 (PST) Received: from ?IPv6:::1? (luna-749a6f85f554075d0000f.net.as198747.daniil.it. [2a0e:97c0:38f:0:d570:455f:58f6:a947]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac2845fb54fsm18917066b.152.2025.03.08.05.38.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Mar 2025 05:38:34 -0800 (PST) Date: Sat, 8 Mar 2025 14:38:30 +0100 (GMT+01:00) To: internals@lists.php.net Message-ID: <74c4c726-63aa-44e0-84c9-840e13a65a4f@gmail.com> In-Reply-To: References: <9964db8c-0ffe-43d5-8246-47fc76b07180@app.fastmail.com> <78a03dd0-fd4a-4f4a-ad8a-37e5704f06fc@app.fastmail.com> <08c8ad0b-e8f4-46e3-99f0-b80748d40b89@app.fastmail.com> <07973EAE-2D83-47A8-8FA0-84286C77C02B@rwec.co.uk> <48d66433-3ae9-4895-8361-7c81a0a3670d@app.fastmail.com> <8599eb8b-d4a3-4cb8-899a-25b134e0d64d@gmail.com> Subject: Re: [PHP-DEV] PHP True Async RFC Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6_250549312.1741441110823" X-Correlation-ID: <74c4c726-63aa-44e0-84c9-840e13a65a4f@gmail.com> From: daniil.gentili@gmail.com (Daniil Gentili) ------=_Part_6_250549312.1741441110823 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit > The async block as I'm picturing it has nothing to do with function colouring, it's about the outermost function in an async stack being able to say "make sure the scheduler is started" and "block here until all child fibers are either concluded, detached, or cancelled". There's no need for such a construct, as the awaitAll function does precisely what you describe, without the need to introduce the concept of a child fiber and the excessive limitation of an async block that severely limits concurrency. There is absolutely nothing wrong with the concept of a fiber without a parent, or a fiber that throws an exception (or a cancellation exception) out of the event loop. A panic in a golang fiber surfaces out of the event loop (unless it is catched with a recover), just like an uncatched exception in a fiber surfaces out of the event loop: it makes no sense to severely limit concurrency with an async block just to handle the edge case of an uncaught exception (which can be handled anyway with an event loop exception handler). In general, I really don't like the concept of an async block the way it is presented here, because it implies that concurrency is something bad that must be limited and controlled, or else bad stuff will happen, when in reality, a fiber throwing an exception (without anyone await()ing on the fiber handle, thus throwing out of the event loop) is not the end of the world, and can be handled by other means, without limiting concurrency. Regards, Daniil Gentili. ------=_Part_6_250549312.1741441110823 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
> The async block as I'm picturing it has nothing to do with function colouring, it's about the outermost function in an async stack being able to say "make sure the scheduler is started" and "block here until all child fibers are either concluded, detached, or cancelled".

There's no need for such a construct, as the awaitAll function does precisely what you describe, without the need to introduce the concept of a child fiber and the excessive limitation of an async block that severely limits concurrency.

There is absolutely nothing wrong with the concept of a fiber without a parent, or a fiber that throws an exception (or a cancellation exception) out of the event loop.

A panic in a golang fiber surfaces out of the event loop (unless it is catched with a recover), just like an uncatched exception in a fiber surfaces out of the event loop: it makes no sense to severely limit concurrency with an async block just to handle the edge case of an uncaught exception (which can be handled anyway with an event loop exception handler).

In general, I really don't like the concept of an async block the way it is presented here, because it implies that concurrency is something bad that must be limited and controlled, or else bad stuff will happen, when in reality, a fiber throwing an exception (without anyone await()ing on the fiber handle, thus throwing out of the event loop) is not the end of the world, and can be handled by other means, without limiting concurrency.

Regards,
Daniil Gentili.
------=_Part_6_250549312.1741441110823--