Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Select on channels (again)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-08-25 (22:19)
From: Nathaniel Gray <n8gray@g...>
Subject: Re: [Caml-list] Re: Select on channels (again)
On 8/24/06, skaller <> wrote:
> The thing is, you can already do this, guaranteed!
> It is rather heavy though: you make two pthreads
> and read one fd in each, then send the
> results down a single Event channel: the user code
> can then read the parsed objects in sequence,
> blocking until the first is available, then blocking
> until the second is available.
> The point is that although this is heavy, it is guaranteed
> to work, so using Event module with pthreads is actually
> easier to reason about.

I understand this perfectly, but I don't think it obviates the need
for select on channels.  The programmer should be free to choose the
approach that suits him best, not have it forced upon him by
limitations in the standard library.

> If you would like to do this without the cost of spawning
> pthreads .. then you need to use Felix, not Ocaml :)

Unfortunately that's not an option for me, but maybe in the future...


>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- -->