Version française
Home     About     Download     Resources     Contact us    
Browse thread
unix.select + camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Anastasia Gornostaeva <ermine@e...>
Subject: Re: [Caml-list] unix.select + camlp4
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