Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126652 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 3C98C1A00BC for ; Sat, 8 Mar 2025 14:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741442926; bh=YV4hHCOEKL7e3+xbr7fUDUNLGHuoUXFdGxvID+4ETfY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KWnyySYMmpJ5GD9kpFdRMyL2gWZkdP/oRmnmv3m7WCC7DTzdJTonJ/BA1tqsP+C3Q U09lLXlVZh05BjwzvxnqQRBPnEKsN3t5L+igK/lzS4zwdOCrFVZAnAooe37if0fMKU XnEjI+ud5Zj7S49DgmNv8/ZdHFbB2rA6QWAx2y5/ZdKZuoK57W7sYbF/HpYFkTJ+8I 1JNlK2IYQH0JNwRxdI2jifZOAxNLolcTMEqCrs5qAI6a2mf61Aong2vIpFiTv1Qksd CG9hoWHf7G2bBc0Z2+MPfJcd/5MyLY2DhS/ks2BaZ8GfDdjD0h3c1d8zhjKREnaua0 69SnsBURuomrg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 341B918060D for ; Sat, 8 Mar 2025 14:08:45 +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.0 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,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-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 14:08:44 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5e5dce099f4so3311699a12.1 for ; Sat, 08 Mar 2025 06:11:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741443078; x=1742047878; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aOSgl80NFV7p9hi4pbSUbRZxJG25eodU1QdgH+UN7tQ=; b=BMaMqLvooRBGH7h7qAnr2H/ClZlH7+RgYV8XlzDbD6s0PwlU6PF+ayH2YHjTKfTUkW HDxNlHrs1SBkQ4A2E6tCd3sOhZnDLBoznCq7XUft3Rc+GLQwFCy1mY1qc4EplLLER+un Qxc2OgN+lLB/ZRxAYWWgJ81jKyN95k7OOLmwPYOBjzm2ZcVOn4Eun9ohdlA5Ma2xaVeg cB3qlCBI2HAWTSaiDhPbqr3rbma8O3Jr+b5lyasqYF7CdQ4U92BdHhf0Ifb1cR0KLi0d J19esRze6/WWxYQM0EvDk5lrAx8sFbmYAeAGzoWc7X4plaKebghmLD0QNYWuTUhdedMy ZVdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741443078; x=1742047878; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aOSgl80NFV7p9hi4pbSUbRZxJG25eodU1QdgH+UN7tQ=; b=aeg3jIWJ9rPeqWiz67IqjGw7K7H2PqNrPGXLD2xY3lgagyed6qLMV+5WAQlcH683w7 bxBY54kKDjtyB6UtnWdaBAYFI/h0GYU6bWb5ykE7OIEUcIAzbuICJmA1vBg8I2NeL+Ce 1ht+8KP69/VwHHAyRBP2aEccQ2yUNsbF2WuR7lpRsk0LS7rEnYhbCwlhTPcXSuuzs4OE Ksp0rrxwC1N2Csbo2WFwpLnF+uDtFR9sAGlsJrMVG1sQnWuTmLtZrXxMa+Cb4vaTsQRk vm2gtprLdtAZxu0KEtJIttjOD/xBM+S1QIORrfU6BqWbCj/4k2rfkpFXZR5xuMaH/lrC 62EA== X-Gm-Message-State: AOJu0Yx1TxuLwzWRQEkrpK6NJJRp0A1UWiD5enlSx0y/W3cHMNc4q7R9 ZRufZax5nwfzqSPbpNkA5KRoCSR83AhNFUqOPn5MMvM7zKi504uvEWsnkB8WVLzIu/KwjWHNjSk D2fsSX8E0YwNkb5zxl3Dn4Skl8c5Uhl2NtCM= X-Gm-Gg: ASbGncvfMx1TUFmciaGNmVLmDtT+N3QqNwcJqZl3v4yKiJ2xrYAAMcxU77TyPhmRs/3 GU5IHZL/5I5wW/EuD2NIqkzlwIFf9yAyVq1++db9vKC3q9YVx+2djJBJvI9MULxPv0kw+lH82GC o6md3GtjGendkPf9Co9BvYh3pYMy8dMjMqJQDn X-Google-Smtp-Source: AGHT+IG9Vke/25SwkznroZKdIYRQFr01RpJ+PE1udBxZXqggkR6ublTmTndlmNnTBZbjBpZOFM23VrELiGy6ABuDoeY= X-Received: by 2002:a17:907:3f1e:b0:abf:4d97:9ec3 with SMTP id a640c23a62f3a-ac2526434f1mr877220666b.13.1741443078245; Sat, 08 Mar 2025 06:11:18 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 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> In-Reply-To: <74c4c726-63aa-44e0-84c9-840e13a65a4f@gmail.com> Date: Sat, 8 Mar 2025 16:11:06 +0200 X-Gm-Features: AQ5f1JqkbNe2Rquznr99N0fSjBX7gnnhZgGUkMtum2QGAPiyykgS80ntUwPquPU Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC To: Daniil Gentili Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000137772062fd550a7" From: i.miroslavov@gmail.com (Iliya Miroslavov Iliev) --000000000000137772062fd550a7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable One person observes 3 persons and he is curious what they are doing because it looks strange. The first person digs a hole. The second person buries the hole. The third person waters the buried hole. He asks them: Why are you doing this? They say: There is a fourth person that plants the seeds but he is sick right now. On Sat, Mar 8, 2025 at 3:41=E2=80=AFPM Daniil Gentili wrote: > > > 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 chi= ld > 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 uncaug= ht > 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. > --=20 Iliya Miroslavov Iliev i.miroslavov@gmail.com --000000000000137772062fd550a7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
One person observes=C2=A03 persons and he is curious what= =C2=A0they are doing because it looks strange.
The first person digs a h= ole.
The second person buries the=C2=A0hole.=C2=A0
The third person w= aters the buried hole.
He asks them: Why are you doing this?
They sa= y: There is a fourth=C2=A0person that plants the seeds but he is sick right= now.


On Sat, Mar 8, 2025 at 3:41=E2=80=AFPM D= aniil Gentili <daniil.gentil= i@gmail.com> wrote:
=20 =20 =20

> The= async block as I'm picturing it has nothing to do with function colour= ing, it's about the outermost function in an async stack being able to = say "make sure the scheduler is started" and "block here unt= il all child fibers are either concluded, detached, or cancelled".

There= 9;s no need for such a construct, as the awaitAll function does precisely w= hat you describe, without the need to introduce the concept of a child fibe= r and the excessive limitation of an async block that severely limits concu= rrency.

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 e= vent 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 th= e 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 gener= al, I really don't like the concept of an async block the way it is pre= sented 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 hand= le, thus throwing out of the event loop) is not the end of the world, and c= an be handled by other means, without limiting concurrency.

Regards,=
Daniil G= entili.


--
Iliya Miroslavov Iliev
--000000000000137772062fd550a7--