Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126675 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 E17B51A00BC for ; Sun, 9 Mar 2025 12:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741523983; bh=9e0nw4oKORA42YWR3X079GAnXnTkD6DpIJQUwUmYpew=; h=Date:From:To:In-Reply-To:References:Subject:From; b=RTsAcsVYIuf5Vi3hl+Gn1/QfJyrnnUTWvD6KJNntqX2WWNrdQgmSCfPeFmPQQDzGB 2V8UZ6fXQAmSRgxmVaGr4a6Sowuyy7D/hOqJUHPnAlOvKwx0bNXxDR17RMsowq6eNQ B0pMNifh+ypts9u8dCmwDiIwUoTmOIBj2FMV9feTRmgoX3SqfK1dzyo4OOzZZEUYNE mFG045fGzzSU/YdYEWBcBV1Y40yyx4YkIy6dnJGjgJ+Oafo5UaLFUCVv/7Xk03V0Rx iqrduNH0PJUy1HYLmbhLzIsLQmiN5ViLczQaYJ8RD7yCq6vVLzDlFwGWWB7yRtcfWh 2jY/eQTgi1p+Q== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 26B29180032 for ; Sun, 9 Mar 2025 12:39:42 +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_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-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 ; Sun, 9 Mar 2025 12:39:41 +0000 (UTC) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-abf5f4e82caso640535566b.1 for ; Sun, 09 Mar 2025 05:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741524135; x=1742128935; 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=MFVcAKE9gAZx7MOdLpRQhdp97V4w0uTTdf2W5cV1/Oo=; b=mM0XDxXfwlFjJExUID8WvOUtuI61UYEm78CTPGRLLKx/uyr2pVBDkxtBx/ciTqpmzt AjnSmGmA3/HGC8dHVMWn3/pYIxm1M9fHE5Y74Q3vdxroSK04gFJRhj/MtepEPxBsi2k6 9U4RVAXLJnJVIQQvgb5Ck5K61fNJGiasqp/AbdmABty79RIXughz96ht7CKug2YDzAvR 9hDkY6Z+/iKRE90Ooz8yl/2oSGOg/4qp4b2lKdVme4qghE4qO1097KOxXmAkYK80eB4l vpnIhgL6odZAP3QqM7sUK8CjC8sicuNkEauo8CiX6n30c30wWyn7laelL4/ubEO+g2Sh CkzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741524135; x=1742128935; 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=MFVcAKE9gAZx7MOdLpRQhdp97V4w0uTTdf2W5cV1/Oo=; b=fNnR7dP7AMPpwpPOeNBidhUJGq6no9NyU5L5aKUUlZlEjsPH+oMtWcfehrmB1um1l4 FmCjXV/E74ij4wv7JVANbQPGgVeLRgQIyR+fSkpdGlT6y6Ys4i8KisfRIB/47RZCuoqM gOcpgnoFihA+XU4EZc4sUotC37Tw0fOgx9rsh/SpldEyK+W8vzbzkUHamrtLLgfeoeOr liBFBXoh9KY8X4SHj8sUoY/ZcQNXrwB23unIokyL9UkPaesbyJUfRO/dI1Vvn4BAJKKU o4sHe6OxopPIymoKTwRWYdgEuT1D1mPhGkhYnCLT4+haKW7EksMaKsccBg6Eu/Z1u2vJ y3Cg== X-Gm-Message-State: AOJu0Yx2oL3F3OTUcMdqWVzXV++J3JvcCWBjbOY6M4qKnRyTyrBUc/D3 rnFW/a9gCsUd5YgUAk7jK5tBIEOYraw+huWm5MH4kJDiS7QUcpWKGgdp2w== X-Gm-Gg: ASbGncsslfTeREl/7/wajAnShh+SeZspSbQFCFMJT69ln498RU+bJV7yK4x/kU2hT10 zzh0VSfFnlw4OV+X1DBHj1dfPfuQW1mvOIc1ZStvUfRwcTAYC2ucLnxDhSmSZR8h1xP65zOKwmn 0plK/OuF3du9Wh4aI14htK9zAq7YNqOTVQTwmEfJZdWTnQLSQqX6ciIr8+D3y74HCRyFJEYVyCO fWYEMdkMPU5O9gqWwGOnv2b1Vh5fd6NRGaYtRJ6aJywaBgGBQlgmmuSGz7CO2FRtEyFyrEnpmQ2 skiSPy3dcArZHOBHDkkT3bOsE8loJjoCYmk9chJdZXmHWBCf4Lu6WB17d2MTsx8NbS2yN1fPM/y gf6vk9kN0pT/yp4LnKyoUOP/giO+L X-Google-Smtp-Source: AGHT+IH4QFbREE0x6405D0LX0rXDxBk8tgDvHWTPUwhRuet++EwIEaNxyedFI5e7sUr0AAoB9O/77A== X-Received: by 2002:a17:906:6a06:b0:ac2:96c1:6375 with SMTP id a640c23a62f3a-ac296c167bcmr139191866b.25.1741524134664; Sun, 09 Mar 2025 05:42:14 -0700 (PDT) Received: from ?IPv6:::1? (luna-749a6f85f554075d0000f.net.as198747.daniil.it. [2a0e:97c0:38f:0:d570:455f:58f6:a947]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac2394858a3sm595197266b.62.2025.03.09.05.42.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Mar 2025 05:42:14 -0700 (PDT) Date: Sun, 9 Mar 2025 13:42:10 +0100 (GMT+01:00) To: internals@lists.php.net Message-ID: In-Reply-To: <589e1df3-3584-4986-a62a-74cbedb2eb92@rwec.co.uk> References: <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> <77DC5F50-531D-49E8-8BE2-504A19CB5FFD@rwec.co.uk> <676e36e4-0b84-4d8c-b3db-2998831cd79d@gmail.com> <510B8EF1-9D07-41A8-9EA0-7D99CF7BFC91@rwec.co.uk> <589e1df3-3584-4986-a62a-74cbedb2eb92@rwec.co.uk> 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_20_44704843.1741524130813" X-Correlation-ID: From: daniil.gentili@gmail.com (Daniil Gentili) ------=_Part_20_44704843.1741524130813 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > I think you've misunderstood what I meant by optional. I meant that putti= ng the fiber into the managed context would be optional *at the point where= the fiber was spawned*.=C2=A0 > > It sounds like you think: > > 1) The language absolutely needs a "spawn detached" operation, i.e. a way= of starting a new fiber which is queued in the global scheduler, but has n= o automatic relationship to its parent. > 2) If the language offered both "spawn managed" and "spawn detached", the= "detached" mode would be overwhelmingly more common (i.e. users and librar= y authors would want to manage the lifecycle of their coroutines manually),= so the "spawn managed" mode isn't worth implementing.=C2=A0 > > Would that be a fair summary of your opinion? Indeed, yes! That would be a complete summary of my opinion. If the user could choose whether to add fibers to the managed context or no= t, that would be more acceptable IMO. Then again see point 2, plus even an optional managed fiber context still i= ntroduces a certain degree of "magicness" and non-obvious/implicit behavior= on initiative of the caller, that can be avoided by simply explicitly retu= rning and awaiting any spawned fibers. Regards, Daniil Gentili. ------=_Part_20_44704843.1741524130813 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
> I think you've misunderstood what I meant by optional. I meant that putting the fiber into the managed context would be optional *at the point where the fiber was spawned*. 
>
> It sounds like you think:
>
> 1) The language absolutely needs a "spawn detached" operation, i.e. a way of starting a new fiber which is queued in the global scheduler, but has no automatic relationship to its parent.
> 2) If the language offered both "spawn managed" and "spawn detached", the "detached" mode would be overwhelmingly more common (i.e. users and library authors would want to manage the lifecycle of their coroutines manually), so the "spawn managed" mode isn't worth implementing. 
>
> Would that be a fair summary of your opinion?

Indeed, yes! That would be a complete summary of my opinion.

If the user could choose whether to add fibers to the managed context or not, that would be more acceptable IMO.

Then again see point 2, plus even an optional managed fiber context still introduces a certain degree of "magicness" and non-obvious/implicit behavior on initiative of the caller, that can be avoided by simply explicitly returning and awaiting any spawned fibers.

Regards,
Daniil Gentili.
------=_Part_20_44704843.1741524130813--