Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126678 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 1A3581A00BC for ; Sun, 9 Mar 2025 16:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741539276; bh=IzRKIj5v8OLFKotDe99OezjAvtMkHJNXlDX/pDv5ccM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dWTzSH/JlOQg8PbQdTIlYPmg4Ncg8gTD/dPwInrEUPFyaeV53w5/fVLxXX2XmYyPu QdD/sIDD7JWVWLfqxw9D60fMPUiGRD+FOPFn8P0ElZFXzLF7f6tV1BpZ7Md85iUgwX 1881sU40ZuT9mf3C03NmnRyOAo7FhB1dlWS9DL8qyoHHLRdE+ohEaLOPCQqGA1+TL/ M61M3OqkgdMEJntc/kuq9ZDPd5druP5Z76hk07t8ctcaf7LPo4jxvg50bd5w55HlKw ru7L1VSQyxgwONKEoP9QHBFeXRVBUeVWA8Fpbr7ESk3zfZElvvbUxHzk/ZBcruux1E s0sgwojmlrAZQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5F317180037 for ; Sun, 9 Mar 2025 16:54:35 +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_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-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) (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 ; Sun, 9 Mar 2025 16:54:35 +0000 (UTC) Received: by mail-yb1-f176.google.com with SMTP id 3f1490d57ef6-e3978c00a5aso2701473276.1 for ; Sun, 09 Mar 2025 09:57:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741539429; x=1742144229; 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=v03LZnhagmq6Jszh/ex7hgeznCLs7nJ/UHJJfYtLm4w=; b=As32lF3pdGqzqG1yYcdYzJSuNaZNhZGaNoiuQ6fQo+PXZ/Y/B5H/U/BuOfwByFLGoh pjQ6sP2AoQ+8PB2bigfihEatY5klUcMuEANXZoUdDOr+UV3JA5k2w6QJB5fWqozvvnsg GOeAxGbpsG62pVlGOzc0jy9+6MWOLZ4l9mZOFfyDAEaECWF0UqKri/qo41waeqsGqG2M GZv7pEYtKYXZhgjzmz7+mAML98kyrHtg66FiF43yBR0LBUzOhnfW84CWgB9Owzpa5z+L yFcQpibZiy98jMMSYss5eNe1PZx9DSO4aUzau62tj//L7yihhtK+4E68BIyK+MkH+9JG HREg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741539429; x=1742144229; 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=v03LZnhagmq6Jszh/ex7hgeznCLs7nJ/UHJJfYtLm4w=; b=plMilbAQ9YMyh/GiS/RjOKn3uFzQw5Z2D1nErV9u+uOn1Wn47a8lxM4vaE4TcstSIr ZR/LgxAAfbrmVx5dWu4Ped+0xIA0yDZnw3Fg/jTaPBbEm+UOCrEeOHvHMYB24V/DxWha 2rDPnCjoErXCqDc5lYh9ncsGbyaKKDUKYf13B+xRWTbuXWwjn6e73Mm6aS5p97o3Fbyw 5W9TmYvnv8APyzO1DLKk+Q/p3EfwYGr0VweI17c5pcH7HFt8M9d3mcALsc/YB6KVzvOD l3HLd91IX+GL3/XBW3xDsOtqcNwPdvWfXCWj2Qf4dxTolnB4/JdgCZhroRbgK8P5FqF8 ptHg== X-Gm-Message-State: AOJu0YzqoeECBUn4c6Rk7LX2VFu7BCRP1mrThWrkdP4bM5wJ93ohJ2KX SASAvuoHzPInRpjQGRWPXsLPgyILOSBS92bBrxa1RK++l1J2YBHk3+Cc7f3JkSk1cQHSGCBJB9U WV4D/7LDmANg+/v/r4/tezeUd+rg= X-Gm-Gg: ASbGncsHMR3kqQ3ROqYk4bSH7tih/mRMDsDdhFo8ZYhG0zLnkbRCBTIfVEcA8TdJzcH qN5rVA6Oou8s0HEWA06yp7qsgT/cbMj8qx+IWQjfmSivdVoCo1bAv5sufVS05CSElYaNjt+EVI+ Jqe33zUS3HQRWZkMbLjwEttOPgSQ== X-Google-Smtp-Source: AGHT+IErN/dvpAi67dQ3IpbYfEhIHYlm+ruseZwbP6f/rbJ1MhZIHo20lRF6gFMiETTa3FpBuIeXmuzh8RimZchHi8o= X-Received: by 2002:a05:6902:288b:b0:e5a:cece:f373 with SMTP id 3f1490d57ef6-e635c1d40edmr10946335276.36.1741539429035; Sun, 09 Mar 2025 09:57:09 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <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> <77DC5F50-531D-49E8-8BE2-504A19CB5FFD@rwec.co.uk> <676e36e4-0b84-4d8c-b3db-2998831cd79d@gmail.com> <510B8EF1-9D07-41A8-9EA0-7D99CF7BFC91@rwec.co.uk> <4690cff0-7a48-4fe0-8310-688be253f976@gmail.com> <4871b2e4-353e-424f-92b9-7e2bb753bafa@gmail.com> In-Reply-To: <4871b2e4-353e-424f-92b9-7e2bb753bafa@gmail.com> Date: Sun, 9 Mar 2025 18:56:57 +0200 X-Gm-Features: AQ5f1JqpULLTnxkJd4QDazKQLnUOg44I3iQXrC6l3G_-BsAk26zk3bNW-NSTc8c Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC To: Daniil Gentili Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="00000000000007b962062febbfbd" From: edmond.ht@gmail.com (Edmond Dantes) --00000000000007b962062febbfbd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > I can give you several examples where such logic is used in Amphp libraries, and it will break if they are invoked within an async block. > Got it, it looks like I misunderstood the post due to my focus. So, essentially, you're talking not so much about wait_all itself, but rather about the parent-child vs. free model. This question is what concerns me the most right now. If you have real examples of how this can cause problems, I would really appreciate it if you could share them. Code is the best criterion of truth. > > You misunderstand: > Yes, I misunderstood. It would be interesting to see the code with the destructor to analyze this approach better. *Let me summarize the current state for today:* 1. I am abandoning startScheduler and the idea of preserving backward compatibility with await_all or anything else in that category. The scheduler will be initialized implicitly, and this does not concern user-land. Consequently, the spawn function() code will work everywhere and always. 2. I will not base the implementation on Fiber (perhaps only on the low-level part). Instead of Fiber, there will be a separate class. There will be no changes to Fiber at all. This decision follows the principle of Win32 COM/DCOM: old interfaces should never be changed. If an old interface needs modification, it should be given a new name. This should have been done from the start. 3. I am abandoning low-level objects in PHP-land (FiberHandle, SocketHandle etc). Over time, no one has voted for them, which means they are unnecessary. There might be a low-level interface for compatibility with Revolt. 4. It might be worth restricting microtasks in PHP-land and keeping them only for C code. This would simplify the interface, but we need to ensur= e that it doesn=E2=80=99t cause any issues. The remaining question on the agenda: deciding which model to choose =E2=80= =94 *parent-child* or the *Go-style model*. Thanks --- Ed --00000000000007b962062febbfbd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
>
>=C2=A0 I can give you several examples where such logic is used in Amphp libraries= , and it will break if they are invoked within an async block.
>
<= br>

Got it, it looks like I misunderstood the post due to my focus. = So, essentially, you're talking not so much about wait_all= itself, but rather about the parent-child vs. free model.

This question is what concerns me the most right now.

If you have real examples of how this can cause problems, I would really= appreciate it if you could share them. Code is the best criterion of truth= .

>
>=C2=A0 You misunderstand:=C2=A0
>

Yes, I misunderstood. It wou= ld be interesting to see the code with the destructor to analyze this appro= ach better.

Let me summarize the current state for today:

<= ol>
  • I am abandoning startScheduler and the idea of preserving b= ackward compatibility with await_all or anything else in that = category. The scheduler will be initialized implicitly, and this does not c= oncern user-land. Consequently, the spawn function() code will= work everywhere and always.

  • I will not base the implementation on Fiber (perhaps only o= n the low-level part). Instead of Fiber, there will be a separ= ate class. There will be no changes to Fiber at all. This deci= sion follows the principle of Win32 COM/DCOM: old interfaces should never b= e changed. If an old interface needs modification, it should be given a new= name. This should have been done from the start.

  • I am abandoning low-level objects in PHP-land (FiberHandle, SocketHandle= etc). Over time, no one has voted for them, which means they are unnecessa= ry. There might be a low-level interface for compatibility with Revolt.

  • =C2=A0 It might be worth restricting microtasks in PHP-land and= keeping them only for C code. This would simplify the interface, but we ne= ed to ensure that it doesn=E2=80=99t cause any issues.=C2=A0=C2=A0

  • The remaining question on the agenda: deciding which model to choose= =E2=80=94=C2=A0parent-child or the Go-style model= .

    Thanks

    ---

    Ed

    --00000000000007b962062febbfbd--