Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88555 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 770 invoked from network); 29 Sep 2015 15:37:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Sep 2015 15:37:00 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.180 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.212.180 mail-wi0-f180.google.com Received: from [209.85.212.180] ([209.85.212.180:34061] helo=mail-wi0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/33-20099-A10BA065 for ; Tue, 29 Sep 2015 11:36:58 -0400 Received: by wicfx3 with SMTP id fx3so156610683wic.1 for ; Tue, 29 Sep 2015 08:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=r/O9+46jSDL5OLm2omJzPapkDHUdtTWIAN3YazXhHgk=; b=GiPJWVfdIe69E0rzFszOjmVewYZuAiDUCbxrMjqocpZJzcCHtyvDQGG9ZhGZ5eb1Ih bfGpK4YVKZco9f+0OLk4yl9ZT38bJNMvtfV9SNJ2AUAG8GpOEEhuIPsvh0OhiPH1l7zi eFcur4r4ujEatuu1Rv2fWe4zA9V8H+1j6B9JSmnjxsrs0/TtD3dKSOl9SKUQqDfJPGxb H3voKX0Ub28ggjRXDv0EEvABWeSgyJejdwELNuuTfRpWdqHkshI9HRK+EdvlP1iHqyM1 Ym2ix2Mj2bIO6FWBWEu+D3j16i2js+v7BVQd6eg/n6xAJjeBHkWH2BmL5/PHra8E8Qyy MFgg== MIME-Version: 1.0 X-Received: by 10.194.201.130 with SMTP id ka2mr16791966wjc.123.1443541015129; Tue, 29 Sep 2015 08:36:55 -0700 (PDT) Received: by 10.28.55.18 with HTTP; Tue, 29 Sep 2015 08:36:55 -0700 (PDT) In-Reply-To: <560AACB6.9080909@cubiclesoft.com> References: <56095A0C.4070306@cubiclesoft.com> <1443529244.15520.67.camel@kuechenschabe> <560AACB6.9080909@cubiclesoft.com> Date: Tue, 29 Sep 2015 11:36:55 -0400 Message-ID: To: Thomas Hruska Cc: Joe Watkins , =?UTF-8?Q?Johannes_Schl=C3=BCter?= , Kalle Sommer Nielsen , Pierre Joye , Levi Morrison , PHP internals , "S.A.N" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] async/await - is future reserved words in PHP 7.x? From: ircmaxell@gmail.com (Anthony Ferrara) Thomas, On Tue, Sep 29, 2015 at 11:22 AM, Thomas Hruska wrote: > On 9/29/2015 6:52 AM, Joe Watkins wrote: >> >> We shouldn't reserve words on a whim ... >> >> async/await doesn't solve any problems for multithreaded programming, at >> all ... it solves problems for asynchronous programming, a different >> concept ... let's not confuse the two ... > > > Actually, it does. Asynchronous and multithreaded programming are attempts > at solving the exact same problem: Simultaneously handling multiple data > streams in whatever form that takes whether that be network, hard drive, > random device XYZ, RAM, or even CPU. Parallelism and concurrency are not the same thing. There are a ton of resources on this, but I'll point to two specifically, Rob Pike (from GoLang): https://www.youtube.com/watch?v=cN_DpYBzKso and Joe's own blog: http://blog.krakjoe.ninja/2015/07/the-universe-is-not-aware.html > Async/await is both the best of and THE solution to both worlds. A whole lot of people would argue that. It's not that it's not a good solution, but it's *A* solution. Each mechanism (event loops, threading, channels, compiler-driven-concurrency, etc) has its own pros and cons, and handle different situations better. A simple example is that raw threads can scale across CPUs, but event loops typically can't (since it's typically single threaded). That's not to say it's impossible to write a cross-CPU event loop, but that requires additional implementation/constraints. There are such non-trivial tradeoffs to each, that there's no clear "best" solution to any of it. Async/await is one way. Golang's channels are another subtly different yet very good way as well. Another even better way may be to take an approach which is to leave it to the compiler to figure out what can be made async (though that may not be strictly possible with PHP in most cases). Claiming that one technique is the victor, without explicitly stating the constraints that are required, is not a great idea. Anthony