Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88558 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6522 invoked from network); 29 Sep 2015 16:15:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Sep 2015 16:15:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=rdlowrey@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rdlowrey@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.181 as permitted sender) X-PHP-List-Original-Sender: rdlowrey@gmail.com X-Host-Fingerprint: 209.85.213.181 mail-ig0-f181.google.com Received: from [209.85.213.181] ([209.85.213.181:35545] helo=mail-ig0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/00-05836-239BA065 for ; Tue, 29 Sep 2015 12:15:46 -0400 Received: by igbkq10 with SMTP id kq10so80720654igb.0 for ; Tue, 29 Sep 2015 09:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=PLSffNOyWWfQmcPeeZhG+m4bjlO5sQrvreXlx6mVR8c=; b=nTVGggo5vosn73Vyncbu2WNrCTyhsZU8bCfUm2l1+P/8JU2hr8autTXhtZwh8x+K6v lArUWunqKwi/UmxqBbd0zhAI6lOOqGsV4ouHT+lYbJJGSfqydqTEekZxhPZDX/8PDoGW nh/2UPkSWWBMeSlZ0Ed30I9K0Hwqvf5nVreNitiRDqT7+wSA31BmHiNaZMGokaBB97bb 6l0cnvYG4+AJblN34NzB27mJjqQm7aa6R34bRAiIhXMMcUzts1vVvWhW1CPl8v1n+IKl G231Szrd9eAmv452+APV2V43s9W5RRi8K3TBCzQyQXV9y81RheBqPumIYcxPMa4PNVLb qYEQ== MIME-Version: 1.0 X-Received: by 10.50.66.197 with SMTP id h5mr24529670igt.69.1443543343402; Tue, 29 Sep 2015 09:15:43 -0700 (PDT) Sender: rdlowrey@gmail.com Received: by 10.36.62.7 with HTTP; Tue, 29 Sep 2015 09:15:43 -0700 (PDT) Date: Tue, 29 Sep 2015 12:15:43 -0400 X-Google-Sender-Auth: eIwImlRB49xC3MN-oRWMUJ7Y5xA Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7bd6be0e3395420520e520c8 Subject: Re: async/await - is future reserved words in PHP 7.x? From: rdlowrey@php.net (Daniel Lowrey) --047d7bd6be0e3395420520e520c8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > On Sep 28, 2015, at 3:29 AM, S.A.N wrote:> > Are = there any future plans for - async/await?> This need to know now, not to us= e these words to constants, and class names...> > -- > PHP Internals - PHP = Runtime Development Mailing List> To unsubscribe, visit: http://www.php.net= /unsub.php> Would this be awesome? Yes. The issue is that all of PHP's built-in IO operations are currently synchronous. It would/will require a massive effort to (1) install the infrastructure to offload blocking operations to worker threads and/or (2) convert many synchronous IO operations to a non-blocking paradigm. Someone has to do that work ... and it's a lot. I don't personally see this happening before 8.0 though I'd be happy to be surprised. FWIW I'm a big proponent of libuv here and think we could significantly improve PHP as a language by incorporating it to solve this (and other) outstanding issues in a cross-OS manner. In the nearer term, this is exactly the sort of thing the Generator Return and Generator Delegation RFCs implemented in 7.0 are designed to handle. With a minimal amount of userland code you can resolve coroutines in userland as lightweight threads in which IO is accomplished with non-blocking libraries. The obvious drawbacks to using yield in userland as a surrogate for async/await is the proliferation of non-standard userland libraries (of which several good options already exist) to manage IO, timers and event loops. IMHO userland shouldn't know anything about *how* concurrency is achieved (whether using threads or nbio). With something like libuv internal C code would have access to a built-in worker thread pool designed specifically for a non-blocking paradigm. This would allow us to expose the best of both worlds. Just my $0.02 on the topic. --047d7bd6be0e3395420520e520c8--