[MLton] OS.IO.poll problems

Vesa Karvonen vesa.a.j.k at gmail.com
Wed Apr 4 04:36:32 PDT 2007


On 4/3/07, Wesley W. Terpstra <wesley at terpstra.ca> wrote:
> On Apr 2, 2007, at 4:50 PM, Matthew Fluet wrote:
[...]
> > On the other hand, one can always use pollToIODesc and
> > (pollToIODesc o infoToPollDesc) and use equality on the iodesc.
>
> That's what I'd do if I was implementing something using OS.IO.Poll.

Yes, that would be possible, but...

> Unfortunately, that mechanism is pretty weak. The few times I've done
> networking with MLton I've had to rewrap the system 'kqueue' and
> 'epoll' methods:
>    svn+ssh://mlton.org/svnroot/mltonlib/trunk/ca/terpstra/st

Indeed.  I think that even with just poll (or select), it would be much
better (faster) to use an interface that makes you register/deregister
fds rather than copy possibly long lists of poll entries back and forth.

> I'll note that wrapping libevent
>    http://en.wikipedia.org/wiki/Libevent
> is might be a good idea if you need windows support.

Hmm... I'll have to consider that.  Thanks for the tip!

-Vesa Karvonen



More information about the MLton mailing list