Sharing in D

downs default_357-line at yahoo.de
Fri Aug 1 01:02:22 PDT 2008


superdan wrote:
> Walter Bright Wrote:
> 
>> Jason House wrote:
>>> Walter Bright Wrote:
>>>
>>>> http://www.reddit.com/comments/6u7k0/sharing_in_d/
>>> This is one of my 3 big wishes for the D language.
>>>
>>> The artical talks about shared being transitive just like
>>> const/invariant. I certainly hope it's more like pure than transitive
>>> invariant.
>> Pure doesn't apply to data types, it applies to functions. I don't know 
>> what you mean.
> 
> looks 2 me more like more of the confusion in yesterthread.
> 
>>> Allowing access to thread-local globals is a bad idea.
>> Why? Global thread local storage is even enshrined into C++0x.
> 
> 99% of the global shit i ever defined i wanted to be thread local. i had to take special measures to make it so. 
> 
> dealing with globals in one thread is shitty to boot. using globals to communicate across threads is sheer suicide.

What about cases that depend on external resources, like a global buffer object for HTTP downloads?

In that case you want cached results to be available to as many threads as possible, especially if the respective server has a high latency.

 --downs



More information about the Digitalmars-d mailing list