RE: communication between thread
30 Mar
2001
30 Mar
'01
11:47 a.m.
I am using the library oncurrent of GHC. I'd like to know how two different threads can communicate each other. 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 in haskell.
You can use the various concurrent data structures in the Concurrent library. See: http://www.haskell.org/ghc/docs/latest/set/sec-concurrency-abstractions. html The simplest form of communication is through an MVar, which is a thread-safe mutable variable. Cheers, Simon
9282
Age (days ago)
9282
Last active (days ago)
0 comments
1 participants
participants (1)
-
Simon Marlow