I've seen the TVar is a simple container, while the TMVar is the same as an MVar, meaning it has a lock etc, but within the STM monad. I am wondering why would that be necessary, as the idea of the STM is to make locks unnecessary.

So which is the one to use if you, say have a type like [Handle] a list of socket handles that you want to use between threads made by forkIO?

Edit
Report