
31 Dec
2010
31 Dec
'10
4:19 a.m.
Hello, I wish to use a mutable array in multiple threads. Can IO arrays be used in any thread, or only the thread they are created in? (So if I create an IO array in one thread, pass it to another via an MVar, can I read / edit it in that other thread?) Similarly about IORefs... can they be used across threads? (Obviously I will need to manage locking myself if I use an IO ref or array.) Are there any good resources on concurrency in Haskell that would answer questions similar to these? I've been learning by reading the ghc library documentation, but of course it's not comprehensive. The online tutorials I've seen aren't so in-depth, either. Thanks, Eric