communication between thread

Simon Marlow
Fri, 30 Mar 2001 12:47:20 +0100

> I am using the library oncurrent of GHC. I'd like to know how two
> different threads can communicate each other.=20
> To solve the problem I thought in something like a global variable. If
> there any method to avoid the use of that kind of variables=20
> in haskell.

You can use the various concurrent data structures in the Concurrent
library. See:


The simplest form of communication is through an MVar, which is a
thread-safe mutable variable.