
Hi, Am Sonntag, den 27.05.2007, 14:07 +0400 schrieb Bulat Ziganshin:
Hello Joachim,
Friday, May 25, 2007, 9:57:45 PM, you 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.
i don't read your letter carefully but at least there is throwTo function what implement exactly what you said in subj. look Control.Exception module docs and read "awkward squad" paper:
"Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell" http://research.microsoft.com/Users/simonpj/papers/marktoberdorf/marktoberdo...
I don’t like throwTo because then I need to keep track of which threads are currently interested in the signal, to not accidentally throw an exception to a thread that does not expect it. Just seems too dangerous to me :-) Greetings, Joachim -- Joachim Breitner e-Mail: mail@joachim-breitner.de Homepage: http://www.joachim-breitner.de ICQ#: 74513189