On Sun, May 27, 2007 at 12:22:54PM +0200, Joachim Breitner wrote:
> Hi,
> 
> Am Samstag, den 26.05.2007, 14:29 +0200 schrieb Tomasz Zielonka:
> > 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.
 
Of course it is not "I" that you might need, but "It" - the STM :-)
Writing "I" instead of "It" is one of the most frequent errors I make
when writing in english - perhaps a sign of egocentrism...?

> No, I haven???t done anything with STM yet. Maybe I???ll look into that.

If your threads just wait until the server state satisfies some
condition, then STM should fit naturally.

Best regards
Tomek
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to