Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Nathaniel Gray <n8gray@g...>
Subject: Re: [Caml-list] Re: Select on channels (again)
On 8/24/06, skaller <skaller@users.sourceforge.net> 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...

Cheers,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->