From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id C5C97BC69 for ; Mon, 2 Jul 2007 17:39:35 +0200 (CEST) Received: from home.mk.pp.ru (av6800.comex.ru [217.10.34.155]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l62FdZJg011048 for ; Mon, 2 Jul 2007 17:39:35 +0200 Received: from ermine.home (ermine.home [192.168.2.2]) by home.mk.pp.ru (Postfix) with ESMTP id BC28A20A24; Mon, 2 Jul 2007 19:39:34 +0400 (MSD) Received: by ermine.home (Postfix, from userid 1000) id BF84D1B581C; Mon, 2 Jul 2007 19:39:34 +0400 (MSD) Date: Mon, 2 Jul 2007 19:39:34 +0400 From: Anastasia Gornostaeva To: skaller Cc: caml-list@inria.fr Subject: Re: [Caml-list] unix.select + camlp4 Message-ID: <20070702153934.GA1911@ermine.home> References: <20070701203044.GA4434@ermine.home> <200707012137.46921.jon@ffconsultancy.com> <20070701210125.GB4434@ermine.home> <1183342234.15100.6.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <1183342234.15100.6.camel@rosella.wigram> User-Agent: Mutt/1.5.15 (2007-04-06) X-Miltered: at discorde with ID 46891C37.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 0100,:01 parses:01 non-blocking:01 parser:01 parser:01 camlp:01 parsing:01 wrote:01 wrote:01 unix:01 caml-list:01 module:03 stream:04 nonblocking:04 On Mon, Jul 02, 2007 at 12:10:34PM +1000, skaller wrote: > On Mon, 2007-07-02 at 01:01 +0400, Anastasia Gornostaeva wrote: > > On Sun, Jul 01, 2007 at 09:37:46PM +0100, Jon Harrop wrote: > > > I dont understand: Try: > > 1) It receives "1-2+3*" and parses it. > > 2) Later it receives "4" and continues parsing. > > > > I want to get non-blocking parser. How to implement? > > Put the parser in a thread, select in another thread. > Use Stream.from f for the parser. Write f to get characters > using the Event module, send the characters from the other thread > after select makes a channel active. It looks awful if you want to run houndreds streams/connections. It is easier to run a connection with a parser in separate thread. So, camlp4 cannot be nonblocking parser.. bad. ermine