Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126433 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 536971A00BC for ; Mon, 17 Feb 2025 19:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1739819790; bh=ds+NrcVY7DKZDwtbA4gWC6ve0bybczySYl94W9repv8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Dn9Y1wDH8EjA72NiCG8+x4xQuI/KV74Ucfo6UNVPzbk7upy+ccj45tkK5QcXwsEr9 y2JOXubMrvj/2DHtWAgzwP7qZELv2nh98y+LbaiIq6tiALpAX2bgFMi5G/pXavXXIv 5zxsH92CWCr6vrJP+ezqcDFZ4MYlguuroeijNKwtfKBLpavTpCzEP6j886S4vPh6OH +KN0xSQ33xKCUYFIqa0X/weI6fM+vY5its1uMZuXcgMS5JlR7ztUFQSZJvNoGW8B6s Lb1I9o6bIYSC31Kh79h1p+YK8S7yb41euwi8dGV/8e8bfTMuAtg5+qkxO/6cx0Im+9 GYwP6KzcNVn0A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C2AE218054B for ; Mon, 17 Feb 2025 19:16:29 +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.8 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DMARC_MISSING,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-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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, 17 Feb 2025 19:16:29 +0000 (UTC) Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-38f3ee8a119so941099f8f.0 for ; Mon, 17 Feb 2025 11:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scriptfusion-com.20230601.gappssmtp.com; s=20230601; t=1739819949; x=1740424749; darn=lists.php.net; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=JVkApVFsPnLDDZxhoYOk3nW+4h0ybtG5mXet/mJGF70=; b=yqfdyzVpCQCEDbFk3EJK9CK6KiSEtig4vmPwCA7/spPHLOymZy5Rz6lIHEn6BZ9A0m hvVXCe1WSG2OWiBT3MnSfTnLxfc4N3/89RHWsAMriFSr/iF11ggojgTBA8TQRWi2MKcM lYySPUb+R0jDbnRIgRen5tN8iZ3vmvY0fmpYsDIWXBYDKsEA/H1B9prUCi9/3vLzjdPi yCv7AzbFI+42OWI2/Z+aw6E1joO/6nxOdZ6HPjz2NbmIsVMgTale1wPVDsNTai/JS2la KWvzC0nT50XFVVUoO7JXu6mWckeguMrdNzlpoS1ITjH1kCgXqzvlNaUlS42R/HYVnBaT Cf6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739819949; x=1740424749; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=JVkApVFsPnLDDZxhoYOk3nW+4h0ybtG5mXet/mJGF70=; b=KetbS46OPddwiWG8xrth8zvLreiWiXOdUWpVFa5QTMg5tYNw0ZmPLILWIZZXB/iu3X LaugrgISiLrcUpNROKm3WjaMvAgCgLSXXCGR38mOojdOKu9avL5EoF1gX61bA3aB8eTK ML0JnyokOtgLVBjabWxkWCH2oXgt1xIpHmD2XffdSWF/BJA1QowaHUaICwxBIMto16CY vmDhwS4nb6ffA8XyNTM5s0GMLCNkdsrTedopowpIkBfqEIsu75/vWiMF2+KCOQLmIbyc +tnB5XlI5dNvgyQ9y8r7vKa1hh/7XVVdLWsOnQNLjzkgrrn4Ir4tIJnIdZXdGTyKxbkb /ReQ== X-Gm-Message-State: AOJu0Ywd1Iukf5b/D2K3dsnER+7BFkGRpzvpg1Rryv4E2Glu8fyYJT1U U2ZYyMCPXdRsj6vaRWjN5zMV3M5LhjXYZZV5KUN5Pq5CNCQAtwp8Ux1jm1Qgbkw= X-Gm-Gg: ASbGncstAaOhvNyVegMBHyo/ZiEVzryE+rv312K7w2mTYt1tx2ZYJb8yCXvTZhwCxUr aKAVHcLkgKu+rtc53va0hfmBoGpPbyeYQrML7uGqUB45cOotkgplWw5k/pXzddqzpAoas5d/92/ OpQiB/7H1adb08E82E9S/r46dhfCEzbjwdNSn7hY9maI0G80IfN85Q0MHRUmwP85IJbwK+Beo6V 7E49Vr36598AcKIhZI6nCz+/m9afoDl7js75MfSNnApCAilb38pehKX2qeoXG+T3End+wQ7BAoP UEd2iM0Hqgrr2dQzVLnjnz6wUca5FO56JwXyqHofJHIap01HxEJFMQBMakwIYzw0chKdjz2hyek = X-Google-Smtp-Source: AGHT+IGjOzgWw6misgY5r/aUncUhnMcgvso1/b82CDUL41eLGc5b95PVqJPooeVKA3nXWOz6YDTz/w== X-Received: by 2002:a05:6000:1568:b0:38f:3de0:d16 with SMTP id ffacd0b85a97d-38f3de00e0amr7037218f8f.52.1739819949372; Mon, 17 Feb 2025 11:19:09 -0800 (PST) Received: from ?IPV6:2a01:4b00:bf09:5101:c4a6:a297:566b:87f6? ([2a01:4b00:bf09:5101:c4a6:a297:566b:87f6]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-38f258b431fsm12879212f8f.2.2025.02.17.11.19.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Feb 2025 11:19:08 -0800 (PST) Content-Type: multipart/alternative; boundary="------------pPwhZ8B565gCmVVTvNODYhFc" Message-ID: <88656d56-7bfc-4966-8fea-4b4ea883f1f1@scriptfusion.com> Date: Mon, 17 Feb 2025 19:19:08 +0000 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] PHP True Async To: Edmond Dantes Cc: internals@lists.php.net References: <24becc76-b67f-4805-b33b-cd4f9f6d0b30@scriptfusion.com> Content-Language: en-GB In-Reply-To: From: bilge@scriptfusion.com (Bilge) This is a multi-part message in MIME format. --------------pPwhZ8B565gCmVVTvNODYhFc Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 17/02/2025 18:53, Edmond Dantes wrote: > > I forgot to mention this. There is an important *_limitation_* in how > this solution behaves in the context of PHP. > > Calls to PHP functions that normally block execution in the zero-Fiber > do not change their behavior. This solution has both advantages and > disadvantages. The advantage is that it does not break *backward > compatibility* in any way. Calling |sleep(10)| at the beginning of > | > *True Async* changes the behavior of functions only if they are > running inside a Fiber with an active Scheduler. > > This is yet another consequence of this architectural decision, and > some people might not like it. However, at this point, I don’t see a > better solution that would be optimally balanced between legacy > support, explicit behavior, and implementation simplicity. > > Have a nice day! > > Ed. > There should be no perceptible difference between a blocking sleep(10) and an async sleep(10), so what backwards compatibility are you referring to? Bilge --------------pPwhZ8B565gCmVVTvNODYhFc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 17/02/2025 18:53, Edmond Dantes wrote:

I forgot to mention this. There is an important limitation in how this solution behaves in the context of PHP.

Calls to PHP functions that normally block execution in the zero-Fiber do not change their behavior. This solution has both advantages and disadvantages. The advantage is that it does not break backward compatibility in any way. Calling sleep(10) at the beginning of <?php will cause the process to go into a wait state.

True Async changes the behavior of functions only if they are running inside a Fiber with an active Scheduler.

This is yet another consequence of this architectural decision, and some people might not like it. However, at this point, I don’t see a better solution that would be optimally balanced between legacy support, explicit behavior, and implementation simplicity.

Have a nice day!

Ed.

There should be no perceptible difference between a blocking sleep(10) and an async sleep(10), so what backwards compatibility are you referring to?

Bilge

--------------pPwhZ8B565gCmVVTvNODYhFc--