shared and cryptic error messages

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Mar 30 20:10:54 PDT 2011


TLS takes some time to getting used to. Doing multithreading in a way
forces me to stop using globals, because I always get bitten when
spawning new threads and only later realizing that my globals have
been re-initialized to their .init value. The new thread ends up
reading mostly zero-initialized values. And that of course leaves me
scratching my head when my code does something unexpected.

But I like the idea of having each thread do its own job. A thread for
the GUI, a thread for some special input devices, a background
high-priority thread that does heavy processing on some prealocated
data, and maybe a logging thread for debug builds. That's what I'm
aiming for at the moment, anyway.


More information about the Digitalmars-d mailing list