Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126665 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 BA4711A00BC for ; Sat, 8 Mar 2025 23:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741475654; bh=ngn+oARz0otATWeGx8u35+cDtqhlYmzrsPQ0/BgGeZk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AiIzferrUS0/n0waFk0u4AsOZ4iRM27nImXpR2WdDZCA8QYQQkHUl23TFoprnyRpH +eQqnkvNEaQhoH+0t1NaGVZy/Ic6/WN8t/Fs4HvFhwPJPP9GaqmOf+arR9M+KG8B4V sygo74mIZ0ctZTXkOQvRe+VTErn09mAZ+jmxXNItylPXmwXkPvRgRYYfWMBgEUl/cr MgThxLGe+2Moi8xG0NErINN4orS73GQaOhbHVTn7O/MbjXdWRqdpmXbQa29jM0r3On OCJYfJxgweV2ZcRVSdH03jO4zJBTShHuRG4r7heHuTRArbKTA9uhoWlyFtomXH+W+h Kz96ZiSQ8Izhg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EF1A2180050 for ; Sat, 8 Mar 2025 23:14:13 +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=-1.2 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_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-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (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 23:14:13 +0000 (UTC) Received: by mail-yb1-f182.google.com with SMTP id 3f1490d57ef6-e3978c00a5aso2407656276.1 for ; Sat, 08 Mar 2025 15:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741475808; x=1742080608; 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=eCWuQj5fzPHiIC8oCmK+2g4qM1gPKUjPBb3wUYt931k=; b=C+Tz2OkFtRuAZLKxBO35qPnJ2w6mgyfzVPFHXvNbZjZyMIbI9gOPYwzyQllTbYhbyW h6J2K69NnG2tkDItG1SImQV2TAuJSx1Ju2RD17BlxwfDjeI9fnhexPP4MzrTDbYrWRTc eCWR3KcN/IAm7Lx6fG+4q8Tyn0CwjYnkRCh98stIWvJf7E5TURwWiisK5cm88pgkBYhg RETFyOtNEvdIypdA8wTH1wftrBjDp9s2gj6bDDFMzthmLgnqRZsXxfznRTfuBtnAG/CZ TkrHXjO51s2FROPFBMxrpaUBu8i5VOu2C25ZYsYZdgaLJNZp2lswIUv/oirKWDTizvWf ttZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741475808; x=1742080608; 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=eCWuQj5fzPHiIC8oCmK+2g4qM1gPKUjPBb3wUYt931k=; b=vmLLvm+D1eTEfwinmsM0Z5FnCEpwjaBLKnCwsvPEjJYzTCEsCimSX0oULFBITfMllv dc9D9phPKZbX3sQEU992imN8nqbIcYM0RfvyfXPsVAQMrZBHxGyeSUJDkHbnN0nO055h lDP1E+XSQFpPr0SvnJAsrduW162lX19/nDaCUxbjcM/ekSTDbjyvdCTx0ggCCLCcmWae egfZo6A6Ijyg6MxXaKBNnDTv8ALrCxymGvG4hHJLF4oMbs5C9J8fQFlKFqjUv4Dt+mk1 mNZ+mntIXCjrZ8I87Sg49JmehZumgsbEZB2xzp4+aIhL87ihK4Q6fG2lusS6slcMHKlt GVPg== X-Forwarded-Encrypted: i=1; AJvYcCUSvgNWGnQq82EoJuEcx9LNowNa7TzDJzPuiPkOPxxybHF1OpqTzx+9MhIs/jU9FtQAyBcZHeVxW40=@lists.php.net X-Gm-Message-State: AOJu0YxG039OyyrO21+psuwUlntpX2eUmZPK8xBYYYJqABKARM6goo0A gaLX4X/xCcZExR9IasvvFH7Ej1CEOvZF9sCh4CWDNGaDKPmIWggt9yRgl9FNBbj0bLQETYnwpjg iSyZT3FOlLv2CCWi/wqG1FJCzmB0= X-Gm-Gg: ASbGncvxxqvUiD4+GAUTsTWboGEOXlD4y2pVRWiEW9jjOLdcSLv4lQ7Ct62VfshwFtU sbMYupLz0JJvMwADEDCaa1sYK5wpCW1qi/NL19tvxw7XaXfvZT+Lx5tDOuRDdj2JphJxTwdfgy5 f4OFrv/PBmBH27xwVzJAyWb1K6kw== X-Google-Smtp-Source: AGHT+IH+x/DLHgKYIo8Z0Up2RE1PTkBTAXXt6my5Usv2yZ7OYhEY5cKatkK0wulVbtPK3/gY/6FV/NxIJ4mdphKcL54= X-Received: by 2002:a05:690c:48c5:b0:6ef:8e4c:65ea with SMTP id 00721157ae682-6febf2a5cc2mr119855117b3.5.1741475807628; Sat, 08 Mar 2025 15:16:47 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 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> In-Reply-To: Date: Sun, 9 Mar 2025 00:16:37 +0100 X-Gm-Features: AQ5f1JpZ0Sc2qSR3S1OcYtGXF-N-sDWzppyjZVbNMTjP0_axo0RFJgoY_qOGxfs Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC To: Edmond Dantes Cc: Daniil Gentili , PHP internals Content-Type: multipart/alternative; boundary="000000000000e62633062fdcee29" From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --000000000000e62633062fdcee29 Content-Type: text/plain; charset="UTF-8" Hi Edmond, On Sat, Mar 8, 2025, 19:18 Edmond Dantes wrote: > This situation is solely due to the fact that the Scheduler contradicts of > Fiber. > > - The Scheduler expects to switch contexts as it sees fit. > - Fiber expects context switching to occur only between the > Fiber-parent and its child. > > > Can you please share a bit more details on how the Scheduler is implemented, to make sure that I understand why this contradiction exists? Also with some examples, if possible. Reading the RFC initially, I though that the Scheduler is using fibers for everything that runs. And that the Scheduler is the direct parent of all the fibers that are started using it. I understood that those fibers needs to be special ones and suspend with a "Promise-like" object and resume when that is resolved. You mean that when one of the fibers started by the Scheduler is starting other fibers they would usually await for them to finish, and that is a blocking operating that blocks also the Scheduler? In that sense, any long running blocking operation is not compatible with the Scheduler... If you can please explain a bit more with some more details and examples, it would be great. Thanks! -- Alex --000000000000e62633062fdcee29 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Edmond,

On Sat, Mar 8,= 2025, 19:18 Edmond Dantes <edmon= d.ht@gmail.com> wrote:
This situation is solely due to the fact that the Scheduler con= tradicts of Fiber.
  • The Scheduler expects to switch contexts as it sees fit.
  • Fiber expects context switching to occur only between the Fiber-parent = and its child.


Can you plea= se share a bit more details on how the Scheduler is implemented, to make su= re that I understand why this contradiction exists? Also with some examples= , if possible.

Reading t= he RFC initially, I though that the Scheduler is using fibers for everythin= g that runs. And that the Scheduler is the direct parent of all the fibers = that are started using it.
I understood that those f= ibers needs to be special ones and suspend with a "Promise-like" = object and resume when that is resolved.
You mean th= at when one of the fibers started by the Scheduler is starting other fibers= they would usually await for them to finish, and that is a blocking operat= ing that blocks also the Scheduler?
In that sense, a= ny long running blocking operation is not compatible with the Scheduler...<= /div>

If you can please explai= n a bit more with some more details and examples, it would be great.
<= div dir=3D"auto">Thanks!

--=C2=A0
Alex


--000000000000e62633062fdcee29--