Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126650 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 88B031A00BC for ; Sat, 8 Mar 2025 13:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741441425; bh=UmtZWNTGdjeowCih3Ur195TqJiSSMJdbUeJ6tzb/lH8=; h=Date:From:To:In-Reply-To:References:Subject:From; b=lYc80hpbwReHX2YrzZicnXNlRHkcb9O0tkmbMmKH+5Hzo00YGJM6WX3BrEWxFZ8w3 4+3ySKNaa3aj929PsnSpGQGBe7PpwcpT06EEyOQ8viCHV8+24h2d/7KvASP0VsA+Ky 94cmD7My1182Wx0M7+a97o9xqQ7ykknYKgxhBsLRdw5+PVzyoQXjEkIwZTDs8Ryaja XMEOcWkGRuca4oOYyJlWkmAnCgVNhVVdKlDSlKKhoTzy0c/qpL02uoQ9aoNaUATLmA mmY5YDXOGa2mdqlWEihjXwQRfLsvdXovW9vAvja1HOnEVxogIvcxZnsXgTKsecXRWR y6HaZaqmnoj1g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1494B180382 for ; Sat, 8 Mar 2025 13:43:44 +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=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) (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:43:43 +0000 (UTC) Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id 57C9211400CC for ; Sat, 8 Mar 2025 08:46:18 -0500 (EST) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-11.internal (MEProxy); Sat, 08 Mar 2025 08:46:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1741441578; x=1741527978; bh=UmtZWNTGdj eowCih3Ur195TqJiSSMJdbUeJ6tzb/lH8=; b=CFp3iz2fa+c2aFBRa/685gpzdV VBnCJFJfHN6gF5HkiRFs2ZUXsVMSCvOkZ6qKwK33upJK5nCk0D7wwvOyDlmfBxx9 FgsxX5ixy4tnqyMZihHVacOL4j+Mdc49+MI8GUI+mvFNZ9pK0LC6eh+jBlUbqJIJ dMJ1ksNNv66Af+HAksvdTkYZZaUSrkGvYQp/r+GSgrQhBc9mSdGTvHMIsn7opy4o kIpB+VlLjNaglye9l7wDN1Szq38XXgd3sZ9njRV14TmerpqHBuyjjGu3qX5SuL0w xuA9MAZYwVRNQla0ykcWgSxpnWD5zXwR1lAnm8hJ5UBlX7zYfY+TkkaHc2sg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1741441578; x=1741527978; bh=UmtZWNTGdjeowCih3Ur195TqJiSSMJdbUeJ 6tzb/lH8=; b=Xx8gvIUEUvKjVC1wKW3LjgyLLDDrX+tXgtbhnh2ID+/p7xEaYx3 PrST/q3pi6thdoCgthhiI+On3/VQ46zH8f15UFinFmaX++51RM9d88MfCq/W27Lu WPi7gMB4OSWfYsVibwjqnTklRJthgD/YOv/903gdnD+SD63TkTetjWuVdzZwoiyt CcesT/dA5WmWiwlIXOKGxmKtfMZ7k/WvSnuEQWpX0hxutta/AyIux9dn4HBPDMYx 54GBcRzxXSiu3rYOL0RN939QwTWyB6RSxXDOLWvbFlYe2Q9LanTXb5HQiLOMy0ce XUEH8fmPa/6oxv5FQ/bAOq8hsB025CZSiPg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduudefjedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefogg ffhffvkfgjfhfutgesrgdtreerredtjeenucfhrhhomhepfdftohgsucfnrghnuggvrhhs fdcuoehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrghtthgvrhhnpedtue ejtdethfeulefhtdelieduteelffdtudelheffgedtieehhfelieejgfevgeenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrohgssegsohhtth hlvggurdgtohguvghspdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdp rhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id C44A7780069; Sat, 8 Mar 2025 08:46:17 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Sat, 08 Mar 2025 14:45:57 +0100 To: internals@lists.php.net Message-ID: <9b7ab30f-5ed6-400d-b941-1291e9185286@app.fastmail.com> In-Reply-To: <74c4c726-63aa-44e0-84c9-840e13a65a4f@gmail.com> 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> <74c4c726-63aa-44e0-84c9-840e13a65a4f@gmail.com> Subject: Re: [PHP-DEV] PHP True Async RFC Content-Type: multipart/alternative; boundary=30e5857263944dbea60ad9ee2d19b75f From: rob@bottled.codes ("Rob Landers") --30e5857263944dbea60ad9ee2d19b75f Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, Mar 8, 2025, at 14:38, Daniil Gentili wrote: >=20 > > 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 abl= e to say "make sure the scheduler is started" and "block here until all = child fibers are either concluded, detached, or cancelled".=20 >=20 > There's no need for such a construct, as the awaitAll function does pr= ecisely what you describe, without the need to introduce the concept of = a child fiber and the excessive limitation of an async block that severe= ly limits concurrency.=20 >=20 > There is absolutely nothing wrong with the concept of a fiber without = a parent, or a fiber that throws an exception (or a cancellation excepti= on) out of the event loop.=20 >=20 > 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 su= rfaces out of the event loop: it makes no sense to severely limit concur= rency with an async block just to handle the edge case of an uncaught ex= ception (which can be handled anyway with an event loop exception handle= r).=20 >=20 > 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 b= ad that must be limited and controlled, or else bad stuff will happen, w= hen 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 en= d of the world, and can be handled by other means, without limiting conc= urrency.=20 >=20 > Regards,=20 > Daniil Gentili. As far as I can tell, the entire reason we are talking about this is bec= ause adding the event loop changes the behavior of existing code. So we = cannot "just turn it on". I haven't seen an explanation of why this is the case, but that's how we= got to this point. We need some way to "opt in" to turning on the event= loop. =E2=80=94 Rob --30e5857263944dbea60ad9ee2d19b75f Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Sat, Mar 8, = 2025, at 14:38, Daniil Gentili wrote:

> The async block as I'm picturing it= has nothing to do with function colouring, it's about the outermost fun= ction in an async stack being able to say "make sure the scheduler is st= arted" and "block here until all child fibers are either concluded, deta= ched, or cancelled".

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

There is absolutely nothing wrong with the con= cept of a fiber without a parent, or a fiber that throws an exception (o= r 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 fib= er surfaces out of the event loop: it makes no sense to severely limit c= oncurrency with an async block just to handle the edge case of an uncaug= ht exception (which can be handled anyway with an event loop exception h= andler).

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

R= egards,
Daniil Gentili.
As far as I can tell, the entire reason we are talking abou= t this is because adding the event loop changes the behavior of existing= code. So we cannot "just turn it on".

I ha= ven't seen an explanation of why this is the case, but that's how we got= to this point. We need some way to "opt in" to turning on the event loo= p.

=E2=80=94 Rob
<= /body> --30e5857263944dbea60ad9ee2d19b75f--