Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129431 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 986321A00BC for ; Mon, 24 Nov 2025 13:21:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763990471; bh=Y6lPYB8BIJ16+4LQe+Wtwa9VwaBOOfQEMpOqoaXpaDE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AzdrTmX/JRMFxSVNRt3U+cbLytg9TNGjhYn6Fp67b60+qTYUWJPwdIFOiYvlZ/xxD laWsNEORHfnQMXhI4Yz1z2W8tGyJ1BmtFrnwUYKKF1e6WbTl/Ciw1UwtftZ2y5JDIM Xnrxcb9sEkM8uqP3uLFBJjnl7LNWqvNGiP6DV0C0PltJG41gx3u4OvFO7QD2gfLCQT ptX+hUS/qnd/VA4ZmCE0A2jDOrM1s5tf1MMs93Vhl+oMCYzmHqBWl6nhnnvwefkdvL yfqFvcPsUnSCNUv2fnoe6xdJiVcnqriTroWaB4k1uenqhML3OWm1o6qd6RFVMqJbpm dP0USlXuBNrYA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1880D180079 for ; Mon, 24 Nov 2025 13:21:06 +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,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) (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 ; Mon, 24 Nov 2025 13:21:05 +0000 (UTC) Received: by mail-vs1-f47.google.com with SMTP id ada2fe7eead31-5dbddd71c46so1683665137.2 for ; Mon, 24 Nov 2025 05:21:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763990460; x=1764595260; 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=75HLZgSPMr64Mfbv5LTbnLdfs3NbKjUZRrDZfyqfW/A=; b=g8wNwxo2/zf7BUOrupwdIkxMk4tDAsZ+VUWzjTU1Z44fa2buM6gXOrGSwq4/pnsP+W FmA/R0W+yD+J5H9dkle1Z2iImosUUovMRkivD5Vv3B1Q6nQZrcveG0N3KCenI/nhwRiU Rlr3PEFo2w56kZu4Ds8uWbZucO5aem0Dmm71X1hf/2ly9CwO00aklqmoZuhnW4Ct0d13 /Zlz16q6wl7yeLtFPeyelj/yP3R1w2ItWh5HbhI5rm/Cq1cdSOg5Q0GXqsTyQ5M+wMgj 4DwhwECoO++5VauKJgkrxlj9Xf8fTEOemeDXpVSN3Ltnv6F40fPdyzgLi8t11ciHUWTW vzTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763990460; x=1764595260; h=content-transfer-encoding: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=75HLZgSPMr64Mfbv5LTbnLdfs3NbKjUZRrDZfyqfW/A=; b=ks4TufGY/sh188G0/rBm+S8J25Jade+3OyNAux9PaktOj5TGsFUTaknYakze3RV/6Q VqAPXsCURyiZz2OTbN1WhKfvSRSR60UMXgR0TG38GPLOgHeQX1rpOpazqlaMkaCq1EXL sdP0eetc7PohkMg/uhQJLtvGoO5PBOaN3VpAPrhLqUlZGOCdUYFeHBCwCAW0lZ7wM4I8 /s9dLnluDAFErwbKnM+Rj35vGWxJ00y9Abjykm/iNriqnjZ8n9HkHdHDeIAaJkg/hWiu uW4m+5T9bQfQr8PzTlD4MjjU82z8vfU8lNdQrDFY2lnr+drZQ+UFoXPr4PIX19H9OIg8 hMBw== X-Gm-Message-State: AOJu0Yy3/J1nkHSrHGGKNULFd20hva8VtSHWKDK7efBVugVdwH+0AmeY pK7yp5nVh7HVgldPIRRbIHE0Ue5WEZsvmOk0FaSq72RVyNE3b4jvmTcGGtg9oBu+5CTYT2jFSFY QSu0CZRlKC66ZHQD9NewdcJ9j2CmcW6dkzdVi X-Gm-Gg: ASbGncunXEot6OTML8rUFLwRb460Ks+xV1B2tvMEgr0h4vEI2GmUQrT38box7I6dn4t LHDLMvuI6J59D4u9yFQvdGZwu6iNCUnadC+C3qudQZ7HqiRB145fG9lHw3W5Qm08qTTi58kwqq+ fw9214Gsg+tA05bq67IVkielKeCEYXvx1WU3An2EKHxk8SlG675N7UY6eewW9lOdTKbepw0Vvhr In3O3O5syGL5TDxrjNop8sltR7+8OK65j+DWJ8Eri2Jkx5yldcRg+BsxRNvd0B5e3xs57m9gu6k /ij90PfMEAqkY8rF2sXiHDItaDo= X-Google-Smtp-Source: AGHT+IG4lke2Au63C+WZCWiGLYIqDHfkgP2uQ8wYem4+DG087owUw3q65FOAgqKz1KrSoqUxptGEKzdMcjgLAUPZcDs= X-Received: by 2002:a05:6102:a47:b0:5de:6dc:22be with SMTP id ada2fe7eead31-5e1de43795fmr3148881137.36.1763990460173; Mon, 24 Nov 2025 05:21:00 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <1402906904.784903.1763811759896@email.ionos.de> <2015208655.784984.1763811978476@email.ionos.de> <980296152.1071.1763813573083@email.ionos.de> <92865666.4510.1763818506332@email.ionos.de> <329450798.8037.1763822426377@email.ionos.de> <9287c46c-bc63-4dd0-9792-0f9421959589@rwec.co.uk> In-Reply-To: Date: Mon, 24 Nov 2025 15:20:48 +0200 X-Gm-Features: AWmQ_bkoh8pHQ-bQsDMpHithMbkV6FRNDn1fhgWwUNGl5Y8BZ__7Nj8BrzwHCUw Message-ID: Subject: Re: [PHP-DEV] [VOTE] True Async RFC 1.6 To: "Rowan Tommins [IMSoP]" Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) Hello. > Will Legacy Les see a side effect when he upgrades to SDK Susie's new asy= nc library? That=E2=80=99s the advantage of the idea. Legacy code doesn=E2=80=99t need = to do anything. Let=E2=80=99s assume all PHP code written before PHP9 is code that ran insi= de a single coroutine that was implicitly defined. Let=E2=80=99s say we have a function myFun() with a static variable: ```php `. At the same time, implementing multi-threading support is not required immediately. But once this capability is added, the language semantics will already be fully prepared for it. So props/cons: 1. Coroutines become safe execution containers that cannot accidentally damage shared memory. 2. Old code requires no changes. 3. New coroutines cannot harm old code. And if parameter-passing semantics are introduced, they won=E2=80=99t be able to harm it at all. PHP will forbid a programmer from even trying to pass memory to another coroutine just like that. 4. The language semantics make it possible to describe fully thread-safe code, which can be added in the future at any time without major changes. **The cost:** 1. a developer must write a bit more code to work with shared objects between coroutines. 2. In such a memory model, you cannot obtain the result of a coroutine=E2=80=99s execution twice. 3. And this changes the philosophy of awaiting a coroutine: only one coroutine can wait for another. However, this limitation has many positive sides, because it greatly simplifies debugging. Such a memory model is quite modern and yet not new. It is essentially supported by Go, Erlang, and other next-generation languages. Therefore, if PHP=E2=80=99s strategy is to eventually become a language wit= h parallelism while guaranteeing coroutine safety with respect to shared memory, then this is the right path. But I want to warn once again about the price that must be paid from the developer=E2=80=99s point of view. A developer will no longer be able t= o use reference variables or pass objects between coroutines. --- Ed