Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126578 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 79F2B1A00BC for ; Wed, 5 Mar 2025 12:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741177257; bh=xxl9mhtX04eE3ATNw6a262PCMI37q2iPfQSmWir6Vvs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iV4oGQe349Y8oP/a5X9WBBmhHp+GmYzBZPbdyFT5Yf8EFxzgdICLGAtYf2DGdOf5k Xp+TC149nFezKImPTq5wql/L91tbsKkvLh048QBRHt/ACvjgcBsXlw7nloB9gXb2gg /9uqQ1SlcqnBiDYJBXrXGiiCCGGWgL/2ETOh8E5whPdHO6la4sTHe2//pRGhbkE/81 vgI79qcukXJTLQn9BMLfTLtKJ3D5u0295bzyvS7Zt1TDgvVWbjPpk7lkDj2419M/40 aXq26sbdoLbEoRiB8/FTFB0m1s/ftp2Jfs6KH4H60nTrqqt6JxiM9r6TXQwWAVxdo8 ywXDn0XvmVhUg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C1CBE18007D for ; Wed, 5 Mar 2025 12:20:56 +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=-2.0 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (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 ; Wed, 5 Mar 2025 12:20:56 +0000 (UTC) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-6fd9d9ae47cso12891807b3.3 for ; Wed, 05 Mar 2025 04:23:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741177411; x=1741782211; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=M0qh4wp1bpQkLB3JjWWjVwR4W4OajqHXPypC9cpcewI=; b=bTgFL7AY+oxGcF/7RqOrRp3ghHp649ieiehZ+ALB5Rva9wvBAkielcMETCanRJE6s+ NBDZ27D5hLqvruaDp+6fO+NC74kOoCGAGdKQX3l7A7iRxZ412hWFGf049rFk2VQpF8YS TC7D2FcN3AwqQEvaasKBBrnMmXCmy83c6702bQnBEL8uUDHQRhZhuJLSJqe197DND3NI ZXmeZOt+fZ2jBb0thdPbaX2cdr/ZBa40T32bFpg5y5SFm0N702qsiliY4KDVkqgVRTaq ksyqpi7gksa0mYNxAZuGaILEm6kwSjqGESUy+vu9HplYJwyun+xxdQfB2gYs7kCVoKk1 tupQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741177411; x=1741782211; h=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=M0qh4wp1bpQkLB3JjWWjVwR4W4OajqHXPypC9cpcewI=; b=A1wpAF6q70NLALeIYtIYd38A5fX3HKMPB77fcBgYFxbe6ZUj0HtV1YHceZZBDST8/n bVLnA7+Z/w3Ja7R33zMXu4tBgNaIprGAyGDprQ0c0g9cCO1ot0V/ukiLlt0trm1stLk4 QamGg2m+bh6N1gXQtJ3GgmLNG7YJf8VCtfZQTpzS0Y9lc3AsswUd3lvSaxeulh23f2br /e4Abhu1kVJcqziJUp+nXARnH7jglcjSFHQv28SGsugM/Oa49Uv+m60pgLDVVH4R6JYQ uMHKaqhECi6m5erYsgSrnx8f5XbhW2yTo9cSVuiCHeYzeXJGu+Hx75spp5E9vdPSMC3P GsBw== X-Gm-Message-State: AOJu0YzdZSal29ln/KPHRyhI/LCrMJ7g9ukWJZl/sOZfCorzk1BmPv7l 61fFuY5rYp3qzUclT3dSV5jEn+nQ+tvuoOcmmZib2+xm6OmhAafgRK/mZVZBYgERedsZEiGkaIp MDQxZ02nuOhbAreo3PFbTFZzrCI6La5HX0ho= X-Gm-Gg: ASbGncuoq2DRU/u4r2DP56qC5gpxQs2i9lvBUOtcSRNx/9hEqHD0sEmi1ntmLOEvYO5 uvf5Xu4BrUrjNwYCB75skhOV0LfTjBzNrAAL2SWLmGUzFrbhEbKWANLPgtg4CnGSSYtXUuOYB8A goDh0Hp0fvXsaN6rMj5D5z3XmASA== X-Google-Smtp-Source: AGHT+IElHhJD2XcYJZtk0X1ZlIeyJNdJG4g8QQd2Y9yCv5loeOon3fFBJ8mDMjana6DtYWDe0QXF5IQ9fMFWKadbp1Q= X-Received: by 2002:a05:690c:a86:b0:6ef:5c57:904 with SMTP id 00721157ae682-6fda2fecf2emr36782667b3.7.1741177411601; Wed, 05 Mar 2025 04:23:31 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 5 Mar 2025 14:23:20 +0200 X-Gm-Features: AQ5f1Jog_qEoEoJ_fm7-ynTChgDVs-pqRfAGjP_zb-GtYlvs_CKaGiZI3s5ckqw Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC To: Jakub Zelenka Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000001c1144062f97750d" From: edmond.ht@gmail.com (Edmond Dantes) --0000000000001c1144062f97750d Content-Type: text/plain; charset="UTF-8" Hello, Jakub. > > I thought about this quite a bit and I think we should first try to clarify the primary design that we want to go for. > What I mean is whether we would like to ever support a true concurrency (threads) in it. > If we think it would be worth it (even thought it wouldn't be initially supported), then we should take it into the account from the beginning and add restrictions to prevent race conditions. > If you mean multitasking, i.e., executing coroutines in different OS threads, then this feature is far beyond the scope of this RFC and would require significant changes to the PHP core (Memory manager first). And even if we imagine that such changes are made, eliminating data races without breaking the language is, to put it mildly, a questionable task from the current perspective. Although this RFC raises the question of whether a concurrent version without multitasking is worth implementing at all, my opinion is positive. For PHP, this could be sufficient as a language primarily used in the context of asynchronous I/O, whereas a multitasking version may never happen. I will likely pose this as a direct question in the final part of this RFC. Thanks! Ed. > --0000000000001c1144062f97750d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,=C2=A0Jakub.

>
= >=C2=A0
I thought about this quite a bit and I think we sho= uld first try to clarify the primary design that we want to go for.
>= ; What I mean is whether we would like to ever support a true concurrency (= threads) in it.
> If we think it would be worth it (even thought it = wouldn't be initially supported), then we should take it into the accou= nt from the beginning and add restrictions to prevent race conditions.
>

If you mean multitasking, i.e., executing coroutines in different = OS threads, then this feature is far beyond the scope of this RFC and would= require significant changes to the PHP core (Memory manager first).
And= even if we imagine that such changes are made, eliminating data races with= out breaking the language is, to put it mildly, a questionable task from th= e current perspective.=C2=A0=C2=A0

Although this RFC raises= the question of whether a concurrent version without multitasking is worth= implementing at all, my opinion is positive. For PHP, this could be suffic= ient as a language primarily used in the context of asynchronous I/O, where= as a multitasking version may never happen.=C2=A0

= I will likely pose this as a direct question in the final part of this RFC.= =C2=A0 Thanks!

Ed.
--0000000000001c1144062f97750d--