Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126653 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 qa.php.net (Postfix) with ESMTPS id 54B5A1A00BC for ; Sat, 8 Mar 2025 14:15:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741443190; bh=95/6sHRRHbSfjlecvYc3JyiUZawzIXeh2kdkrMXt3LM=; h=Date:From:To:In-Reply-To:References:Subject:From; b=JpTi2Nk0j2ItlzXpCWqdEO/OA5kMqYFj45eHyrxb+pf2GppWogM1HNnCn5/67TJXo /FvmZBpe5V9COH3HFeGqqZPJmX/EbwGTN+CrktPYNu3htS70DEpseurHXew29MN0Ci yYA0PFVfXU2x9T/tC7JiSNRZe2jQJBFWhb2hFOlOC/JOhW5nqobT/XU/4tIJQwIh8c oZewNeJkSGDizSmp0JzbKuOyeMXboupayVx9TcdCjQOXp+iE/7fVszF5k4eBju9A29 9ZEWPjaE6hb7/JXKjlw6sSc+fQWpoWJbC4ELoo80tgY/ZL8YqYVu0sy3PTu4cb0aWa nQAAscb9zZ+hQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6D96B1801E4 for ; Sat, 8 Mar 2025 14:13:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) 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, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.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, 8 Mar 2025 14:13:09 +0000 (UTC) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-abf615d5f31so534888966b.2 for ; Sat, 08 Mar 2025 06:15:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741443342; x=1742048142; darn=lists.php.net; h=mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=g3Ce9aUHJFn7xuyccvn/lb4DwaNC3LVFZYAe+OzvQUw=; b=InEI3SKaOR7QzYVf/SGrPTLGTl1D3GB8aP5vyRe8dUYI7kRECxiV7PzJT+UKBoPa9c 0xtIm4jaSIzXo8IKyPNy7oOOIP+keCcE5o/h1dIaRT2HAqqrG0+h+GOSeUCezszvOeEA Qulida+2xBCS4lkeczLuz3oNBdM4+9cLG8C7uZ7lRsTTLPsHjQ2S1K6ut4HE+B/XqqRN QPxN144oOYLaShxdaljUAu1T6kWsJhZWdadg4HYoKFQbQfwcFrfPVs0HNLQwn9yyoiez mqHC4OBsEkS1g+WRMWyhZtsszNn0sOlZSDKNscHyg3Z6qucDfl4C7S6gt2KH4BaWHhWX COWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741443342; x=1742048142; h=mime-version:subject:references:in-reply-to:message-id:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g3Ce9aUHJFn7xuyccvn/lb4DwaNC3LVFZYAe+OzvQUw=; b=enjGTo8SIlzQ67uuk+I/KP/u7shUvZGU7LsybSXNAnCCeMIX7+I/uWiiCJcECfq4E3 h/z50W8nSdcJXHtZBPzQWqXue2Di5BUkedlLdyG3WwRo2pfYKgZDbTVFAsQZxrlbn4Fe LSsOeAss8Um5FFcI/cfnAXwtdrNSviOpeJfdAi6Arho9/PwR5vtNZtFeekDldqkbkpv+ sW9/WIT09dIAQsmEmFSWpOWN6Ur92852Xxm1aruNgH7yGHVac7PLYwUjZTejutgbR4GO bh33os8WsRNbJJo4oqSRuZNq07pzAmgWYZtXipbwDb9Rkicn0xopw99fYys24GP4Uohv +fvg== X-Gm-Message-State: AOJu0YychFURN7E4ZuGfiDZiEdSB1sHzY0oq9OOplN89H0ub1rjXwkRZ MqOOlPXf9QDkc1T943aceQ097dAzwt2rtYBsr/8XlpADPtj1i5oFht5y6Q== X-Gm-Gg: ASbGncvCzlj9OVLMOetA+bgaWHw0+bxZuukhhRZ2XhHI38XOCQ0AaDhuZ04FtldsIkD Lr38WqPgOM99gT2cRfaZ4+wrMVMu9zlcscqjbk4frqJLn61dLY118n+WuYyROBPEQQUW3nDd5Tb enYnV8egWGuShPoaOVqstFDyJBiXqKgGTuTX6OILbEYaa0zyO9v19LcFZOwmIoLlZme5C4lzU7X s+Wkl+AJDyBghTN/S9UzGcYxGpUHZb2+BYDtCrECoBZ8OwXK7zwJHr3EROhBe3pH4kXqCCcks6x XuyXHAIr8kFc7JnM6GVCJILWfgGWrDi9Epym5QTbsCzB/H1P X-Google-Smtp-Source: AGHT+IFF9d1UaZVLTMNQYnN4pWlRv57qigyO8fFEl+6ebu2wTuwuNsA6ZRjB9qHbQ+uk/GVQzTk1ng== X-Received: by 2002:a17:907:1b05:b0:ac1:def4:ce20 with SMTP id a640c23a62f3a-ac25262f4c3mr819081966b.18.1741443342351; Sat, 08 Mar 2025 06:15:42 -0800 (PST) Received: from [127.0.0.1] ([78.210.108.99]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac2856445b1sm15153666b.60.2025.03.08.06.15.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Mar 2025 06:15:41 -0800 (PST) Date: Sat, 8 Mar 2025 15:15:37 +0100 (GMT+01:00) To: internals@lists.php.net Message-ID: In-Reply-To: <9a2e81e8-3534-455b-879a-5a45c85b3ba7@gmail.com> References: <9964db8c-0ffe-43d5-8246-47fc76b07180@app.fastmail.com> <78a03dd0-fd4a-4f4a-ad8a-37e5704f06fc@app.fastmail.com> <08c8ad0b-e8f4-46e3-99f0-b80748d40b89@app.fastmail.com> <07973EAE-2D83-47A8-8FA0-84286C77C02B@rwec.co.uk> <48d66433-3ae9-4895-8361-7c81a0a3670d@app.fastmail.com> <8599eb8b-d4a3-4cb8-899a-25b134e0d64d@gmail.com> <74c4c726-63aa-44e0-84c9-840e13a65a4f@gmail.com> <9b7ab30f-5ed6-400d-b941-1291e9185286@app.fastmail.com> <9a2e81e8-3534-455b-879a-5a45c85b3ba7@gmail.com> Subject: Re: [PHP-DEV] PHP True Async RFC Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_16_147921749.1741443337869" X-Correlation-ID: From: daniil.gentili@gmail.com (Daniil Gentili) ------=_Part_16_147921749.1741443337869 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit >> As far as I can tell, the entire reason we are talking about this is because adding the event loop changes the behavior of existing code. So we cannot "just turn it on". >> >> I haven't seen an explanation of why this is the case, but that's how we got to this point. We need some way to "opt in" to turning on the event loop. > > This also seems like a very bad idea: there is no reason for the language hide concurrency behind an INI or even worse a compilation flag. > > Existing code may not all be free from races, but the choice should be up to the user, not the hoster or whoever provides the php distribution. > > Enabling concurrency by default will allow gradual addition of fiber/threadsafety of codebases, as developers will know that concurrency is a (very easy to use) option, and will hopefully want to prepare their codebases for it, and after that happens, it will be even easier for users to use it. In other words, no one's forcing anyone to use async PHP: just because the language will provide a spawn/go keyword to spawn a new fiber, no one's forcing you to use it, you can keep using everything in a single thread, single fiber, no spawning. Crippling async PHP with async blocks just because some libraries aren't ready for concurrency now, means crippling the future of async php. Regards, Daniil Gentili. ------=_Part_16_147921749.1741443337869 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
>> As far as I can tell, the entire reason we are talking about this is because adding the event loop changes the behavior of existing code. So we cannot "just turn it on".
>>
>> I haven't seen an explanation of why this is the case, but that's how we got to this point. We need some way to "opt in" to turning on the event loop.
>
> This also seems like a very bad idea: there is no reason for the language hide concurrency behind an INI or even worse a compilation flag.
>
> Existing code may not all be free from races, but the choice should be up to the user, not the hoster or whoever provides the php distribution.
>
> Enabling concurrency by default will allow gradual addition of fiber/threadsafety of codebases, as developers will know that concurrency is a (very easy to use) option, and will hopefully want to prepare their codebases for it, and after that happens, it will be even easier for users to use it.


In other words, no one's forcing anyone to use async PHP: just because the language will provide a spawn/go keyword to spawn a new fiber, no one's forcing you to use it, you can keep using everything in a single thread, single fiber, no spawning.

Crippling async PHP with async blocks just because some libraries aren't ready for concurrency now, means crippling the future of async php.

Regards,
Daniil Gentili.
------=_Part_16_147921749.1741443337869--