[Haskell-cafe] Broadcast signals between threads

Tomasz Zielonka tomasz.zielonka at gmail.com
Sat May 26 08:29:10 EDT 2007


On Fri, May 25, 2007 at 07:57:45PM +0200, Joachim Breitner wrote:
> I???m writing a TCP server app ATM. It has one thread per client. Some of
> the clients want to be notified if the internal state changes, while
> others are happily chatting with the server, possible modifying the
> internal state. What I need now is a way for the chatting thread to
> signal ???anyone interested??? that the state has changed.

Did you consider using STM for thread synchronisation and communication?
STM uses change notifications (or something similar) internally to
implement the "retry" operation. I might be just what you need, but more
high level.

Best regards
Tomek


More information about the Haskell-Cafe mailing list