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 (or polling) on in_channel?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-04-05 (13:34)
From: Eijiro Sumii <eijiro_sumii@a...>
Subject: Re: [Caml-list] select (or polling) on in_channel?
From: "Alex Baretta" <>
> My impression is that select and buffered IO are concepts that do
> not live well together.

Actually, I don't quite think so - buffering can often be regarded an
optimization and select could be implemented just by checking the
buffer in advance (as others have suggested).  I also suppose there is
at least some kind of buffering even inside UNIX OS kernels with a
"select" (or "poll" in Solaris) system call.

> I would attempt to model the problem in a multithreaded paradigm, where 
> the the "selecting" is implicit in the thread scheduling mechanism.

I rather want to avoid multi-threading if select could be easy enough,
because the former is often too tricky due to the possibility of
deadlocks and races.