Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129239 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 E39441A00BE for ; Sat, 15 Nov 2025 21:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763241502; bh=MDuDgEtUfqJ9KuVldWnw7GSV2i9DNTPMwpUM4biyjnA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jXC442uyL63wqQ70MfEjrEmKnUhK8Iecxdd6bh00ELFPpESHxUWf4foExTJ+yWCAz xZTbBaOJT7U6OgviWmeM2aKZF/VctB+EEi3PiVwZyNTeTr2szdr04yawTdMD+wHIZK L9ZBD4GgYzeZdOlsdemqI1jDZw1DbCXpqlB4wZ3r/9VrCQFPx+iHgpqs9RhBfpvfuk /pQ5blgfQ7zsYdAijsyV4PUV6qEq/E8za9eIZZSAveKQ1ownMFhWCIef3T0DHDViw+ K9PBTBAfiUzBZwT9OUuOYiyCFmH/0F13dqprTzE2+WTJmy2wtlFCqstTk/+PdN3LZy e0FMCGZjNwryw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ED0A2180393 for ; Sat, 15 Nov 2025 21:18:19 +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=1.8 required=5.0 tests=BAYES_50,DMARC_NONE, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.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, 15 Nov 2025 21:18:06 +0000 (UTC) Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-3e37ad3d95aso1893630fac.3 for ; Sat, 15 Nov 2025 13:18:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763241481; x=1763846281; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MDuDgEtUfqJ9KuVldWnw7GSV2i9DNTPMwpUM4biyjnA=; b=ozYXCKnVqDCF8gFLzV1ioi/IJK+IUHFaQShdUg9fPZikBwATV8ktm6V/KBJ0mqw9U/ yfbZV6GM9fYC9r63GcUohgQm86ocgQvr9f2g+sT8CICs2aUEV7046IF1NG9OtT6/oPx6 IdJlOok5GPjg8YFN7cuZOJRhxKcGWVyhsXCoseNTS1nD5f9TipCsPzyL5pF2f2RDXrae P4dUv2EcEV85N60HgpYRUBJ0bUGAG8XmppoI3na9m7hnZFE2ygN9GUHTjxBisp4yvZpi wmauVk/Ox/waa7ycJx7JiMgJ6jhOIUu0QY/Vjy38smzjrlwlp5NKzb+ikzYLEarN1bZs YBmw== X-Forwarded-Encrypted: i=1; AJvYcCWBNAG1itFPbCgsjd9IHUNwHYC4pt47AMHAMF5NLyhkZWFRmdDm5UHvBH/y/3gkAfVPrksf2Ur8fxQ=@lists.php.net X-Gm-Message-State: AOJu0YwXatOInfX+0c8mEGTLynn10io34hU8GFbOwME2d5zmNniQKjJz ue4clSCjN/L0IntbDuKZb9SdeBM/sXjtHhoYB6s0HvwHGYwTZwn+Z5yhJg6K2KhoLQQ9FbpYwCk 6KjrZXdv/vuGCuEh62Oi1J75KfXkIUb8= X-Gm-Gg: ASbGncuLNKWD0gEbkv1CeMVV70Yg5eYJDB4CedUgReAFT8ifpj2Ve4jOxH9RMg+6VkR aWmZv6WhDmG7+ckfNaYNyO3DlYmA88UZU1F7L+sVvyDXLJjRGmaLliYwuVHVoeOKrTVn8draWQm mx1R8WtZhSOYrgxAHV0tZWlhkBMHBqzzllyuNqavPT6yq8KLRc1BzHNwKhA/GMY4N30tZmfsdoW YjPxcSYwB2uBrgTgGFq64uFjBcwe+OuzBQKMwjD+uaJZ6KsYjSc8FwF4rzBIBYpRP1bkQ== X-Google-Smtp-Source: AGHT+IF+i+WTHyW69P9nnWZEmCUnSXqY/upXyUsCfTamabadIaVleGBDi4XEhs3xF8L2DrWHLCxesQEB1ZAi9H4olOQ= X-Received: by 2002:a05:6870:7a8:b0:3e8:93b4:a042 with SMTP id 586e51a60fabf-3e893b4a630mr1329640fac.51.1763241480960; Sat, 15 Nov 2025 13:18:00 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <6618a91c-5393-4f40-88b5-b5041ee09deb@app.fastmail.com> <3e0cf0a1-c1a3-4e05-97ba-0eeb7f559a53@app.fastmail.com> In-Reply-To: Date: Sat, 15 Nov 2025 22:17:49 +0100 X-Gm-Features: AWmQ_bnaLhj6hsk1cRTIQYToCF6kulRKrRxVc2xpuzfRQxgsmzeFy9P_STW1Q38 Message-ID: Subject: Re: [PHP-DEV] Re: PHP True Async RFC Stage 5 To: Rob Landers Cc: Edmond Dantes , php internals , Larry Garfield Content-Type: multipart/alternative; boundary="000000000000203f370643a8a652" From: bukka@php.net (Jakub Zelenka) --000000000000203f370643a8a652 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Sat, Nov 15, 2025 at 8:56=E2=80=AFPM Rob Landers wro= te: > 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 > like: > > Yes, that=E2=80=99s absolutely correct. When a programmer uses an operati= on > 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. > > > I think that "normally" is doing a lot of work here. fwrite() can block, > but often doesn=E2=80=99t. file_get_contents() is usually instant for loc= al 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 intended model, it=E2=80=99d help to have that sp= elled out > directly; it makes it immediately clear which functions can or will suspe= nd > and prevents surprises. > > In the Async implementation, it will be specified which functions are > supported. > > > 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 > contract. > > Even something simple like: > > - if it can perform network IO > - if it can 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 layer and extensions will require special RFC and mainly clean implementation. We will need to carefully consider where the suspension is going to be done. I think if there are parts of the RFC that mention IO, it should be removed here. I think this RFC should also remove any mention of reactor as it's irrelevant for this. Kind regards, Jakub --000000000000203f370643a8a652 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 l= ook something like:

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 oper= ations.

I think that "normally&q= uot; is doing a lot of work here. fwrite()= can block, but often doesn=E2=80=99t. file_get_c= ontents() is usually instant for local files but can take seconds on= NFS or with an HTTP URL. An array_map() <= b>always blocks the thread but should never suspend.
<= br>
Without very clear rules, it becomes impossible to reason abo= ut what=E2=80=99ll suspend and what won=E2=80=99t.


&g= t; If that=E2=80=99s the intended model, it=E2=80=99d help to have that spe= lled out directly; it makes it immediately clear which functions can or wil= l suspend and prevents surprises.

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

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 contract.

Even somethin= g simple like:

- if it can perform network IO
- if it can perform file/stream IO
- if it can sleep or wai= t on timers

None of the above i= s part is this RFC so why is this being discussed. Any of the changes to st= ream layer and extensions will require special RFC and mainly clean impleme= ntation. We will need to carefully consider where the suspension is going t= o be done.

I think if there are parts of the RFC t= hat mention IO, it should be removed here. I think this RFC should also rem= ove any mention of reactor as it's irrelevant for this.

<= /div>
Kind regards,

Jakub=C2=A0
--000000000000203f370643a8a652--