Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75045 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22071 invoked from network); 23 Jun 2014 08:17:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2014 08:17:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.182 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.128.182 mail-ve0-f182.google.com Received: from [209.85.128.182] ([209.85.128.182:47335] helo=mail-ve0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 08/61-14743-D72E7A35 for ; Mon, 23 Jun 2014 04:17:02 -0400 Received: by mail-ve0-f182.google.com with SMTP id oy12so5714412veb.41 for ; Mon, 23 Jun 2014 01:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=zx8Oj6K4Q3sBWT6s6heKvBDyavyvR0r+3abO+x67CVc=; b=U5uR/f3TLPQ4zUnKmZUTNP7IAG1e6ah1YcGkVeBcFtbZTBjNVqbWbSwmokmE+60YGK m4UwLNV2EZ5xcIhnnR8qoqgkV+JeoXecpoEqtZCAULt17rTjT/w+lsA5nFtQ/gDh+PDp i1f1gSfYRhC8XMsRyD2BV3YHRJN7VSzMWbA2NkWJDJRw3lHtJ1gUC7RIk9tWXGVg5CLP 9riK9EzX3jRciGgcRH4DbsKJh/cn+2RkpyQ62x0IPCaMNb8OS8eNHIywHnpaaAg2RwJu nAy212nKtuJulHcLn8GzoRCX/ci5owhzpiIW1elxCGgQCzy5PFgREWywePYx08vryJVp 1rhQ== X-Received: by 10.58.29.234 with SMTP id n10mr18398007veh.16.1403511419516; Mon, 23 Jun 2014 01:16:59 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.81.68 with HTTP; Mon, 23 Jun 2014 01:16:19 -0700 (PDT) In-Reply-To: References: Date: Mon, 23 Jun 2014 10:16:19 +0200 X-Google-Sender-Auth: J6dbpFXu3fle1vYMvTcOXwEMeOA Message-ID: To: Daniel Lowrey Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: Refactoring our IO multiplexing layer From: jpauli@php.net (Julien Pauli) On Fri, Jun 20, 2014 at 6:29 PM, Daniel Lowrey wrote: > On 17 June 2014 12:05, Julien Pauli wrote: > >> Second question will be : do we use, and then link against libevent >> (or any other lib that could fit the need) > > Another particularly strong argument for using a libuv backend is that it > packages fully non-blocking and cross-OS filesystem IO capabilities. You > simply cannot perform non-blocking filesystem IO without delegating the > work to threads and subsequently notifying the main thread asynchronously > upon completion. Here's a useful intro on this topic: That's where things start to turn dark. The library's threading system needs to be made compatible with our thread layer. And our thread layer is not the best designed one... Joe.W would have lots of things to bring to the subject, waiting for his thoughts :-) I was not particulary thinking about filesystem non-blocking IOs, but network's , when first writing this email. Althought I knew some people would bring interesting subjects such as this one. > > http://www.remlab.net/op/nonblock.shtml > > In theory libuv would completely obviate the need for most (all?) of PHP's > existing filesystem code. If we're talking nbio backend alternatives, libuv > vs. libevent shouldn't really be a question. > > P.S. As Generators are now a thing in PHP (thanks, Nikita!), the addition > of built-in non-blocking facilities would mean the language has all the > necessary building blocks to utilize powerful language level concurrency > structures. To avoid userland segmentation and massive library duplication > I think a separate RFC to consider basic structures like CommonJS Promises > or Scala-style Future primitives (my personal preference) would also be > expedient. That would be a nice idea to propose :-) Julien