[Haskell-cafe] STM and `orElse` on a few thousand TMVars

Einar Karttunen ekarttun at cs.helsinki.fi
Tue Dec 6 22:00:46 EST 2005


On 06.12 20:57, Tomasz Zielonka wrote:
> On Tue, Dec 06, 2005 at 02:52:03PM +0000, Joel Reymont wrote:
> > Well, I do need to have access to all those thread handles.

Since thread creation is inside IO anyways you might want to
look at Control.Concurrent.QSem which solves this in an
easy fashion. If you want to use STM then a global 
TVar Int should work fine.

- Einar Karttunen


More information about the Haskell-Cafe mailing list