[Haskell-cafe] Waiting on input with `hWaitForInput' or `threadWaitRead'

Gregory Collins greg at gregorycollins.net
Tue Oct 18 09:36:22 CEST 2011

On Tue, Oct 18, 2011 at 3:18 AM, Jason Dusek <jason.dusek at gmail.com> wrote:
> The lazy bridging code, `lazyBridge', blocks (unsurprisingly)
> and does not allow packets to go back and forth. I think I need
> explicit selects/waits here to get the back and forth traffic.
> Maybe there is a some way to leverage GHC's internal async I/O
> but I'm not sure how to do it.

Maybe: forkIO two threads, one for the read end, one for the write
end? I would use a loop over lazy I/O, also.

Gregory Collins <greg at gregorycollins.net>

More information about the Haskell-Cafe mailing list