On May 19, 2012, at 2:13 PM, japplegame wrote: >> You don't need to mark Tids as shared. > Okay. I'm writting logger. Logger is global object and it is > running in its own separate thread (for example, writting logs to > remote database). > My application has several threads and all of them want to log > something. How to share this global logger between threads? I > think the simplest way is to share logger's thread tid and other > thread can send logs via this shared tid.
Maybe use register(). >> If you originally create it as shared, you don't need to do the casting. > Yes. I don't need to cast to shared, but inside thread I get > shared object and can't store/call/pass it without casting away > that shared attribute. Or I should make shared everyting that > have deal with shared object. > I'am trying to follow Safe D concept, but it forbids casting away > shared. I'll admit that send() has only spotty support for shared. This should be fixed.