
28 Jan
2013
28 Jan
'13
4:27 p.m.
On 13-01-26 05:28 AM, Erik de Castro Lopo wrote:
Thiago Negri wrote:
Do you need advice on what? I didn't understand your last phrase.
Well I have data from two sources, stdin and the calculation thread. If I was doing this in C, I'd probably use a pipe for the calculation data and then do select on the two file descriptors.
There is a select package:
http://hackage.haskell.org/package/select
but I was wondering if there was a more idiomatic Haskell way of dealing with inputs from more than one source.
There are list arrows, and also coroutines in many guises including pipes, conduits, and iteratees. These are all co-operative concurrency, however, and I can't tell if your problem requires pre-emptive threads.