Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129437 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 A37DC1A00BC for ; Mon, 24 Nov 2025 16:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764001957; bh=GTkV1xzH13Gk6kJ/VnUC1Qe7szODrBu5Suit7uZ/fwE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MtcukNg2C2MNbh2XcoBAC16D4p7DJIxS3p/NhYqu07TmMDemYXVK5VSIa3CzSPrWD Qp5fvTUMHXGQnHOAElM9utY4cTByRyzzWA3MzLxQlgSxBVM5nmXjwrM5z13YhfShK7 01wqiwUCZU+aVTIyQUK6tYLfL8H3kUL1WYU6V+ZFFViaRW/H7xyw7L6RXb79hlhM4j AKW+dTGBuUnR/kf6pHEpDzP4Uq0/nACkR7o9IU+l8iHsnnzOj0GgvCpw6t2g++QwmT 4Sji2qmTrFLA3XURm5CJs5WL5iVmmk8XwyPTI2WeP30pFV6KkOaYBtC4RLFD5uRirl 8N+sY+t2Ooz5A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6F0361801EE for ; Mon, 24 Nov 2025 16:32:33 +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-f44.google.com (mail-vs1-f44.google.com [209.85.217.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 ; Mon, 24 Nov 2025 16:32:33 +0000 (UTC) Received: by mail-vs1-f44.google.com with SMTP id ada2fe7eead31-5e18598b9b1so3174834137.0 for ; Mon, 24 Nov 2025 08:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764001947; x=1764606747; 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=GTkV1xzH13Gk6kJ/VnUC1Qe7szODrBu5Suit7uZ/fwE=; b=LNG0OjYtDIu5oq2UiMSLaYgD7rerlhaRwyCnaeDcocXbUIooPKDcwOZLKK+wkxPhSk Nc3uVt6n8df+Mzcvm3Z1j5I1Xmp7kY/1yb3JszbvRTWKYyrq1GO5qBhY+ALU/4U/PjM5 JDgKkZnCrsgOafZJ+wtaB7dcW0RUXgPzwhzDtaQsCJg7XEHkZUsj1oAvjinPF3CqYbFB m6MvSiPC+7Qes4dsZ434daHlJG4D8Qx5HDCdADCWOMW//mTfYkARgNElo5cpNoop22yq ONUgf+sycGsJ5UbX2eUJbTOBAXj6u6Xyr25XT5h708jFUs4/dN9EQoZoqfk0cBu1sDW4 5HPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764001947; x=1764606747; 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=GTkV1xzH13Gk6kJ/VnUC1Qe7szODrBu5Suit7uZ/fwE=; b=uyd32l0H8H1LTi7LHA3+m3LCb88e4tW44625mTgTPkargT4bFaS0xG2bt4ifQHQTfg zHdMr5FM52W1EW9NfJzsctAj5yAkTaIHQzxKB2HX4vYBpVhnv/fxwyCFguXh+ghXMRjV vzzpCuOiVk8j7imXr2sXeuBDHGlps/eWE0A/PmcS/wsZkR9mZ9JBI5M5UzzZsYJ4ptkL FYSjZHPLgY/7xQcwJfsoEj5SLttwrNAaAUOyVARCeMpbAp2eiKhztTBUzTjAYuAOXSBN XnzkwtMX2t7CAZ83LqxA4geCtqvQ+8p+dncOlp/c9reXE+bNSqKjsLvhPMib3sNEyXH0 eWTA== X-Forwarded-Encrypted: i=1; AJvYcCVynfEMoRJ7TbrlYyLRaaeJzuKGRQ+rvk6g8HfiduAR9GSQJbSc0+MHuxAuyloOrKEVnQxiY39rdGk=@lists.php.net X-Gm-Message-State: AOJu0Yz0t+OFNW/nA81guovUklNEFDpa78lydLV4TkuJ5YrYuQFeavmU OmSqlRiPSQhdwMJE0LvAp6RHt3LekyZXub5d52uHOhq/g/gHDTK6pZ8lf8Qt97v5sI61RNbUBXR XrjpXcpBabqqG5+rW8fR2qxDs3TwwtJg= X-Gm-Gg: ASbGncti+VpqIGKZAK/I4doPKXeE9y6bTHAck90L/VcKwm6u/ojoCloQ5xmAok6xxTv Lh6ChjzT7pS2tP3Qk9e8e/ew9/02Pf7SsDyjUPaBGbQC1ZQTNY5ic48To3Q9zgP8mIYSIqaAiFL fEdbppPZuX23smHV2Etau10OHQklVJDgdJC1dXti44L/MVx0XTU3a3pfsHu77YaXZBc9CEPREEQ q6KhPQOzohYyxsaFH++eeOw2IoUaGRnJgwo0UH/DnZhHBG2I4bNJGz/Q3EEMRGfnZvxFEYk9HZX UBlmGZ7iMJLkY5PdL7kE3Q3Yubw= X-Google-Smtp-Source: AGHT+IE8pCoDbHustPFWujreD21UN1q5c51GutwrKRj/OXqbb6E79yC6agQhVGNwbpkwNgex1czu+T4TAAGl/9KfAHw= X-Received: by 2002:a05:6102:5717:b0:5dd:c568:d30d with SMTP id ada2fe7eead31-5e1de2d32c1mr4154916137.30.1764001947324; Mon, 24 Nov 2025 08:32:27 -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 18:32:16 +0200 X-Gm-Features: AWmQ_bk332V9yfdrBh-IG4RcpXNccyVFPmMuUqKjzQWWfz-fX4MW-c6f-de4Xyc Message-ID: Subject: Re: [PHP-DEV] [VOTE] True Async RFC 1.6 To: Jakub Zelenka Cc: "Rowan Tommins [IMSoP]" , internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) Hello > This could be quite problematic for internal objects that might depend on= global that will switch. Yes, this will require changes to the PHP Engine, and we will have to determine their scope. > Something like this should be done explicitly through channels otherwise = it would be quite strange semantically for users. Yes, exactly, channels are an excellent way to explicitly pass objects between coroutines. But thanks to the ownership policy, the developer gains the ability to explicitly clone an object before passing it. Example: ```php function x(own object $y): void { } $var =3D new Obj(); $var2 =3D $var; x($var); // error: can't move object to x, because refcount > 1 x(clone $var); // yes it's possible ``` > I think it should be the only allowed case. Of course > The context switches will likely become more expensive but should be stil= l cheaper than long IO. I don=E2=80=99t know. To answer this question, we need to write code. But I hope it=E2=80=99s possible to find an optimization that has almost no performance impact. To solve this problem, one important change is needed: removing static var from opcodes. This would make it possible to share PHP opcodes between N threads as a readonly structure. I can=E2=80=99t say how feasible this task is. But if= it is feasible, it opens the door to the third memory model (shared nothing). But as you understand, this approach provides the maximum possible level of protection. > This is still limited and supports only basic ops but I plan to add more = ops Yes, this will give additional capabilities for the Reactor. I can see that libUV isn=E2=80=99t in much of a hurry to implement them. --- Ed