Am Fri, 05 Oct 2012 12:58:18 +0400 schrieb Dmitry Olshansky <dmitry.o...@gmail.com>:
> The true problem is not in the code you as a programmer doing > distibuted stuff do. > It's library writers that typically use TLS for some persistent state > inside module > and D currently makes it easy and transparent just like in the old > non-MT days but for threads ONLY. We should probably do some analysis on the phobos source code to see if this really is the case. I thought TLS is mainly used to avoid threading issues, which works for Fibers. Things like the thread local RNG generator variables work fine with usual TLS and even if the Fiber is passed between different threads, this still works well. I think we'd only have problems with APIs which leave TLS variables in an inconsistent state between calls to functions. But I always though such behavior doesn't fit TLS variables well and should be abstracted into a struct+member variable as state. In the end, isn't 'global TLS' state just as bad as global state in C and should be avoided?