Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129042 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 AF3F81A00BC for ; Sat, 1 Nov 2025 16:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762012831; bh=WzMacZCk5jZGVRm+PQfWseI6L4g/KcDyslF2PkEO8k0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MnvSeHv+L8kV6p9v0I7rqdg6OpDxZB9OlYEKQ16u7Q5xpl+GOWJB7dVUsOPOnLqwA pw1D+RsGeOXRLt/sOZ9XDOhjmE1oWDgVK74qsP6bs+4esRv/j/hKmHHbhhl1C+u++z DfE3NbPuq5aFa72egIuQTmQoC68ldzP7ImUxa0+VVhIwjz0gI8CEmVqOWZfyavgpdF 1uoQtgcYxt/oVGuRVBKP2t/Baqa0QS2hKvdvjjFmQUiANzVdStMG5CIY6AqZElD4+v xy+53d83qRjaOh3rBz5gjYv6m2m0B0tpCg/HwVm7eGnxnRW+xav6EyCNl81nPzymD9 tBCbMEWUIdjuQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3786A18006D for ; Sat, 1 Nov 2025 16:00:27 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.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, 1 Nov 2025 16:00:26 +0000 (UTC) Received: by mail-vs1-f41.google.com with SMTP id ada2fe7eead31-5db52533e5eso2958094137.1 for ; Sat, 01 Nov 2025 09:00:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1762012821; x=1762617621; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=M5RP3n5yq+N/LTEE19VegErMjSieJrElWI3uxTNOshU=; b=aaqi1J6RA6RaCrmqKKHn2T62gk9uDoi85xRlb47XfrHYv+xgxiBrgvMTtppDwQq9MN 6KGNcnFP7hkCkTjMqeO69A4s8555nPlKp2FjKxuXJUrINEXj3ljyTwNd9KZyD1mVdgby lSRyTF92f82be9vkTPPLl83rZ7/MbA394fcUYakl2XCLzsR/JV6RF3L0ujL4FSkN14MT wEQocBLa6ivyJof4xM1PaoyCqnBspi07U3QzqSQ8S/NLzy0tlBsLnB/zh/coFcUi574U UnymMIFOCIyse3lW2onj9kw2i4+LQXNtizsNBpjsS3wuW+C2Lw2dCNTLZhEcPRKTkMwF dXlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762012821; x=1762617621; h=content-transfer-encoding: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=M5RP3n5yq+N/LTEE19VegErMjSieJrElWI3uxTNOshU=; b=ITG8A46IqvxyUDkWpjpXXSB7Q60b5lvfPHJsSM054HgcYK1WjDOlp671bG2bCTQ1CZ y1s+9tD47QvlIoKOBe51RSdaR2a6hsLtBmVKB+ihe8ZrSh6FQQ+10ezu16P/qZeaCIe7 q1hU8aeF6xfVszhNUejf138hwuxyRTbrAlpSEtL0Zr5/nspkLa2W4vq0yGeObzMKQ5Je vgBEN8C4HElMfl5Oj0GpzWtpmR88iicbRokMrkmesPF4BsFtQ/ASPTFcUvdM0RNviS6n AFueklaLj5FE8owdOd2ycWMiGxrh74EUqPqRXqrAkjp23GUl1yHKW+ghN7fzW75cYXGX B2rw== X-Gm-Message-State: AOJu0YyUnMJaxQEtjGBffiMrg66ktMDgQkU9wSzM03K/oO3EA1qUoa19 YDU/tVmUGyT5Ga4qXJcZjH2/6DPj3BU99vTCQbIk97cSnx9paaltFUbBrQPTzhOc9moXnflSxLS DsBkjlzDtNN+ISnW9ae1hZb4+AutFvEEXao4W X-Gm-Gg: ASbGncuvkfCdZnFb4r38j0EzWTFClp8dMaYVZQC8aHPBJjyuzg0gU19t0mYsvASGlkS 4+6P4vbkrYru697r8iAYQH40+0Nv2wTWYFJz7nBfQ+R5BfXA0z+XWzMVHUwJQJDhnByeyvust3l lSLqSx+6MOVHKWVViH55i3WbKXw1sICQf5dJ+RaPyRhHeMxxsMJCueGPzavAUnDiC3SIyVT5wbE 78SCz6oGYA4cPmKVmW9LTrZYdKpxLFnWSpb9r/EDhrZAb31/yV8ZDUMBoAfJzkHsVqk347vaDvi xGfaNOCNNN5AVdnMJ6mTtoa/Mj9T X-Google-Smtp-Source: AGHT+IEQwt8SfEZEAD8e2Xk7pl9Pl9sVeBav917enSpQslqxS+Pc6OXynWVNJWCfRbkcnj5NPW1Vm9BXxzGTFJ+S7b4= X-Received: by 2002:a05:6102:588d:b0:5db:c9cd:673d with SMTP id ada2fe7eead31-5dbc9cd6b9amr365036137.26.1762012820975; Sat, 01 Nov 2025 09:00:20 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <2441aa9c-41c8-4ce1-b9c0-67136e5f97da@dennis.birkholz.biz> In-Reply-To: Date: Sat, 1 Nov 2025 18:00:10 +0200 X-Gm-Features: AWmQ_bmRT2eo1EUk8qvNDCWNjPx6AjssghLPZAW-cFdVK4MBMIVcTKVIpwtn0Ro Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC Stage 5 To: Dennis Birkholz Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) > From the standpoint of PHP language user, I have a completely different = view on Fibers vs. Corotines. That=E2=80=99s sad. > They look very similar from the outside Coroutines and Fibers have completely different behavior. I hope you=E2=80=99re not comparing them just by appearance? > I really belief we should avoid fragmentation and enhance/adjust Fibers t= o meet the memory and performance requirements of a Coroutine. But the problem has already happened, and it=E2=80=99s not directly related= to this RFC. Of course, there=E2=80=99s a possibility to bridge the two worlds by callin= g PHP functions from C, but as I=E2=80=99ve said before: just because somethi= ng can be done doesn=E2=80=99t mean it should be done. > If the provided awaitable is itself some infinitely blocking Coroutine (e= .g. while (true) {}), If you have a coroutine with an infinite loop, it means other coroutines will never get control. (more about it by searching for the keyword: =E2=80=9Cconcurrency") The RFC contains an example that isn=E2=80=99t very elegant from a semantic point of view, but is completely correct in terms of logic: ```php // Await task 1, but no longer than 5 seconds. await($task1, spawn(sleep(...), 5)); ``` And here=E2=80=99s another piece of code (Async\Signal is not present in th= e RFC, but it=E2=80=99s entirely possible.): ```php // Await task 1 until a signal occurs. await($task1, new Async\Signal(SIG_TERM)); ``` > In addition, what happens if a Coroutine is suspended and is restarted ag= ain. The Await function waits for the coroutine to complete. The suspended state does not affect the waiting process. The wait is interrupted for two reasons: an unhandled exception or the coroutine=E2=80=99s completion. All of this is described in the RFC: https://wiki.php.net/rfc/true_async#aw= ait --- Ed