www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Questions about shared

reply "weltensturm" <weltensturm gmail.com> writes:
First off, is the implementation of 'shared' finished, and if not 
how long roughly will it take until it's done?
If a whole class is declared shared, is it intended that each 
variable of it has to be defined shared too?
Why isn't it allowed to implicitly cast shared data to normal 
data, or will that be part of the final implementation? It's a 
bit annoying to cast everything back when using external 
libraries.
Mar 12 2013
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Tuesday, 12 March 2013 at 12:11:58 UTC, weltensturm wrote:
 Why isn't it allowed to implicitly cast shared data to normal 
 data, or will that be part of the final implementation? It's a 
 bit annoying to cast everything back when using external 
 libraries.
Because there are no guarantees about what the library function will do with the object. It ensures that you don't accidentally pass a shared object to a function that doesn't think about thread-safety.
Mar 12 2013