[Haskell-cafe] ReaderT and concurrency

Bulat Ziganshin bulatz at HotPOP.com
Wed Nov 16 13:39:51 EST 2005


Hello Kurt,

Wednesday, November 16, 2005, 7:51:19 PM, you wrote:

KH> I'm writing a program that will be using multiple threads to handle
KH> network activity on multiple ports in a responsive way. The treads
KH> will all need access to some shared data, so I'm using an MVar. So far
KH> so good. The problem is that passing the MVar around everywhere is
KH> kind of a pain, so I was hoping to use a ReaderT monad on top of the
KH> IO monad to handle that for me.

there are two alternative solutions:

1) use global variables
2) use implicit parameters (ghc-specific)


-- 
Best regards,
 Bulat                            mailto:bulatz at HotPOP.com





More information about the Haskell-Cafe mailing list