[Haskell-cafe] Suggestiong for inter-thread communication

Mario Blažević mblazevic at stilo.com
Mon Jan 28 17:27:25 CET 2013

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.

More information about the Haskell-Cafe mailing list