On Wed, Oct 7, 2015 at 10:16 AM, Markus Ongyerth <ong...@gmail.com> wrote:

> Mostly because i am used to the poll/select method I mentioned and that
> one works without any threading.
> I don't really mind using the threaded runtime though, it's more habit.
>

The stock stuff in the threaded runtime uses epoll() out of the box. When
you call hRead on a Handle, if the handle would block then you ultimately
get a call to threadWaitRead
<https://hackage.haskell.org/package/base-4.8.1.0/docs/GHC-Conc.html#v:threadWaitRead>
or
threadWaitWrite; these functions register interest in the given file
descriptor, and the IO manager / GHC runtime scheduler will wake up your
thread (GHC uses "green" threads) when the file descriptor becomes writable.

G
-- 
Gregory Collins <g...@gregorycollins.net>
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users

Reply via email to