Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43128 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11731 invoked from network); 20 Feb 2009 05:08:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2009 05:08:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=mark@hell.ne.jp; spf=fail; sender-id=fail Authentication-Results: pb1.pair.com header.from=mark@hell.ne.jp; sender-id=fail Received-SPF: fail (pb1.pair.com: domain hell.ne.jp does not designate 93.17.128.3 as permitted sender) X-PHP-List-Original-Sender: mark@hell.ne.jp X-Host-Fingerprint: 93.17.128.3 smtp21.services.sfr.fr Received: from [93.17.128.3] ([93.17.128.3:42846] helo=smtp21.services.sfr.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/52-28105-DDA3E994 for ; Fri, 20 Feb 2009 00:08:47 -0500 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2111.sfr.fr (SMTP Server) with ESMTP id 08C8E7000087 for ; Fri, 20 Feb 2009 06:08:43 +0100 (CET) Received: from [192.168.0.25] (unknown [77.207.3.30]) by msfrf2111.sfr.fr (SMTP Server) with ESMTP id E7EC57000083 for ; Fri, 20 Feb 2009 06:08:42 +0100 (CET) X-SFR-UUID: 20090220050842950.E7EC57000083@msfrf2111.sfr.fr To: PHP internals In-Reply-To: <499E1D62.5080100@mozo.jp> References: <499DDC23.5000100@gravitonic.com> <499E1D62.5080100@mozo.jp> Content-Type: text/plain; charset=UTF-8 Date: Fri, 20 Feb 2009 06:08:37 +0100 Message-ID: <1235106517.4443.94.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] FD_SETSIZE limitation From: mark@hell.ne.jp (Mark Karpeles) Hi, That's the reason why I started writing an ext for PHP that would implement epoll() on linux, and stuff-with-ws2 on Win32. However I don't mind making this a patch to the stream ext. Basically I get the following functions: consts: STREAM_POLL_IN (read) STREAM_POLL_OUT (write) STREAM_POLL_ONESHOT (other options exists on epoll, but are not portable. Some, like "oneshot" can easily be emulated) functions: resource stream_poll_create() bool stream_poll_destroy(resource $poll) array stream_poll_wait(resource $poll, int $timeout,int $maxevents = -1) bool stream_poll_add(resource $poll, stream $socket, int $wait_flags) bool stream_poll_mod(resource $poll, stream $socket, int $wait_flags) bool stream_poll_del(resource $poll, stream $socket) The goal is to use epoll() on linux, weird win32 stuff on win32 (thingie that converts socket to handler, then allows to use waitmultiple on that), kqueue on BSD and fallback to select on all other operating systems so those functions can be used anywhere. Anyway I was initially planning to use that internally, then maybe release it on pecl, it makes more sense to be inside ext/stream (I guess), so if anyone want to see it faster than that, why not. This can also be made OO, however the current stream ext has nothing OO, so I'm not sure it would make any sense. Anyway feedback about this is welcome, I've been wanting to write this for pinetd (those who heared about a PHP DNS Daemon should know what I mean) as using select() can become a problem when you want to handle a *lot* of clients. I am a bit demotivated, however if there is interest into this, or even if it can make it into ext/stream, I would be more than happy to finish/release that. Mark Le vendredi 20 février 2009 à 12:02 +0900, Moriyoshi Koizumi a écrit : > Robin Burchell wrote: > > On Thu, Feb 19, 2009 at 10:24 PM, Andrei Zmievski wrote: > >> Can someone explain why ext/sockets and also stream socket functions care > >> about FD_SETSIZE? > > > > They care, because they use the select(2) syscall, which cares about FD_SETSIZE. > > > > select(2) itself can handle more fildes than FD_SETSIZE on Linux at least. > > Moriyoshi > >