Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129240 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 lists.php.net (Postfix) with ESMTPS id 87E341A00BC for ; Sat, 15 Nov 2025 21:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763241601; bh=wg/zXQvC3EqDhYOrcKhjaHyoLObUp4PW0wK2Ae10FNg=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=eRfLCUHLocAgir0NklmNN7Lg33KbnPOKB2uji/3bBqHiNNpZMa82pKAHOLRPC0sXp qQS/DbT6K8r/0Cvl4eQ29mGlZ7K/pZJC3q4dsTfLpDhR4qMyuCteXKP4Qr2Rjdb/Z2 yGkFiAlnEqipeOGJLjRa3QXiQWrxKUWqv6PD0SqPJ3fuU2g1cks/d8vs5k0tUbx1RM SwKsvQJ2EcbrfrWrZP5KgGllVTYda20hYmpwTCh5UWpv/3QLlQAJCGXcx05qfj0YDW FZT2uRzdKSF38zhmnFoIuxinRKLIQdHPilOXHGNvCSw/119nYnwBKKa3D7h76JU0d5 X4m2f042KimNw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 348CF1804E2 for ; Sat, 15 Nov 2025 21:19:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,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.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 15 Nov 2025 21:19:55 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id 9EC937A0191; Sat, 15 Nov 2025 16:19:50 -0500 (EST) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-12.internal (MEProxy); Sat, 15 Nov 2025 16:19:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc: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=fm1; t=1763241590; x= 1763327990; bh=wg/zXQvC3EqDhYOrcKhjaHyoLObUp4PW0wK2Ae10FNg=; b=B 6jl+RBXo7eOP0Ieh2/g2x/TY52vm1IprvjhTZAc5Aek7rr0ii2btv+cW4Sq1tnyO NM8cu8HrmeratvRQeDi2oT5Fe42LqAF/LQ66TmeUNKcCgQZz1LdBYZc/ehWlbCN0 ONEvKoLgHPRLsM32cxPh+WrRuZvU0QFZ5HY1xWw8uNPI9CLlUdw0POrM4PmVe74w pqOMQfrzxKVIEVdrrTAnXUcJDGoW4Hyy5y217/K1PSi63s266Ii852FaT4fhYlUj a3jSdwOcyNbwEuc/WsnNypB9PJFNeNsS6swrJtNA1K2k8Dh+s37/hb4k+Q+e764U dyJbTuK0HzC7+I0LYoApA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm3; t= 1763241590; x=1763327990; bh=wg/zXQvC3EqDhYOrcKhjaHyoLObUp4PW0wK 2Ae10FNg=; b=3Atb2NnNie+YRuumBasGcFbwMUwmlHZ7AK8Qw7kC555uZNZk23B nkR1yTXeXAWPqL5iTC1ecbl2eoyz2X3svC/74obrkNxpX9TgH5ID/5d9rWigf+bB IIujMRSO7pinVWRrW6e6E8+TwsiC+mNzeLXHoVYxIrYrgzrzPXIIq1r0MajQSyc5 VIvFMUc12qc0M1PnFUHMQFMhPjgDUGIBvT86r+EzseHP+5w2smAXBUFj6b7si0sk pKUot/9wfAsFdRU/VlhfhxZLdlHvloWQiv4QaDCqqRkZrJGz1ycFEa4A2Ag9gtFJ UjINlkmGCb9/0WtQj6tZmxCwaWL4gFRHwcQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvudefjeeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgesrgdtreerredtjeenucfhrhhomhepfdftohgsucfn rghnuggvrhhsfdcuoehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrghtth gvrhhnpeejtdelkedtheeuteeffeeguedvledtfeejffejgfehtefhteevveefgfdvvdel vdenucffohhmrghinhephhhtthhpuhhrlhdrrghnnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprhhosgessghothhtlhgvugdrtghouggvshdp nhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheplhgrrh hrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhrtghpthhtohepvggumhhonhgurdhh thesghhmrghilhdrtghomhdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrd hphhhprdhnvghtpdhrtghpthhtohepsghukhhkrgesphhhphdrnhgvth X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id EDE521820054; Sat, 15 Nov 2025 16:19:49 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: A2k3WxiDp57Z Date: Sat, 15 Nov 2025 22:19:29 +0100 To: "Jakub Zelenka" Cc: "Edmond Dantes" , "php internals" , "Larry Garfield" Message-ID: <41c5eed0-dd1b-4ea4-99cf-f6d16682bd7f@app.fastmail.com> In-Reply-To: References: <6618a91c-5393-4f40-88b5-b5041ee09deb@app.fastmail.com> <3e0cf0a1-c1a3-4e05-97ba-0eeb7f559a53@app.fastmail.com> Subject: Re: [PHP-DEV] Re: PHP True Async RFC Stage 5 Content-Type: multipart/alternative; boundary=3d024c335a2943ada4b340aef409872b From: rob@bottled.codes ("Rob Landers") --3d024c335a2943ada4b340aef409872b Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, Nov 15, 2025, at 22:17, Jakub Zelenka wrote: > Hi, >=20 > On Sat, Nov 15, 2025 at 8:56=E2=80=AFPM Rob Landers wrote: >> __ >> On Sat, Nov 15, 2025, at 15:41, Edmond Dantes wrote: >>> Hello. >>>=20 >>> > Based on the conversation so far, I=E2=80=99d imagine the list to = look something like: >>>=20 >>> Yes, that=E2=80=99s absolutely correct. When a programmer uses an op= eration >>> that would normally block the entire thread, control is handed over = to >>> the Scheduler instead. >>> The suspend function is called inside all of these operations. >>=20 >> I think that "normally" is doing a lot of work here. `fwrite()` can b= lock, but often doesn=E2=80=99t. `file_get_contents()` is usually instan= t for local files but can take seconds on NFS or with an HTTP URL. An `a= rray_map()` *always* blocks the thread but should *never* suspend. >>=20 >> Without very clear rules, it becomes impossible to reason about what=E2= =80=99ll suspend and what won=E2=80=99t. >>=20 >>>=20 >>> > If that=E2=80=99s the intended model, it=E2=80=99d help to have th= at spelled out directly; it makes it immediately clear which functions c= an or will suspend and prevents surprises. >>>=20 >>> In the Async implementation, it will be specified which functions ar= e supported. >>=20 >> This is exactly the kind of thing that needs to be in the RFC itself.= Relying on "the implementation will document it" creates an unstable co= ntract. >>=20 >> Even something simple like: >>=20 >> - if it can perform network IO >> - if it can perform file/stream IO >> - if it can sleep or wait on timers >=20 > None of the above is part is this RFC so why is this being discussed. = Any of the changes to stream layer and extensions will require special R= FC and mainly clean implementation. We will need to carefully consider w= here the suspension is going to be done. My point is that it *should* be a part of the RFC. =E2=80=94 Rob --3d024c335a2943ada4b340aef409872b Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Sat, Nov 15, 2025, at 22:17, Jakub Zelenka wrote:
Hi,

On Sat= , Nov 15, 2025 at 8:56=E2=80=AFPM Rob Landers <rob@bottled.codes> = wrote:

On Sat, Nov 15, 2025, at 15:= 41, Edmond Dantes wrote:
Hello.

> Based on the= conversation so far, I=E2=80=99d imagine the list to look something lik= e:

Yes, that=E2=80=99s absolutely correct. When= a programmer uses an operation
that would normally block the = entire thread, control is handed over to
the Scheduler instead= .
The suspend function is called inside all of these operation= s.

I think that "normally" is doin= g a lot of work here. fwrite()= can block, but often doesn=E2=80=99t. file_get_contents() is usually instant for local files but can = take seconds on NFS or with an HTTP URL. An array_map() always blocks the thread but should = never suspend.

Without very clear rules, it= becomes impossible to reason about what=E2=80=99ll suspend and what won= =E2=80=99t.


> If that=E2=80=99s the inten= ded model, it=E2=80=99d help to have that spelled out directly; it makes= it immediately clear which functions can or will suspend and prevents s= urprises.

In the Async implementation, it will = be specified which functions are supported.

<= /div>
This is exactly the kind of thing that needs to be in the RFC = itself. Relying on "the implementation will document it" creates an unst= able contract.

Even something simple like:

- if it can perform network IO
- if it ca= n perform file/stream IO
- if it can sleep or wait on timers

None of the above is part is = this RFC so why is this being discussed. Any of the changes to stream la= yer and extensions will require special RFC and mainly clean implementat= ion. We will need to carefully consider where the suspension is going to= be done.

My poi= nt is that it should be a part of the RFC.
=E2=80=94 Rob
--3d024c335a2943ada4b340aef409872b--