[OT] Unity's HPC#

Rubn where at is.this
Thu Feb 28 21:52:51 UTC 2019


On Thursday, 28 February 2019 at 20:53:01 UTC, jmh530 wrote:
> On Thursday, 28 February 2019 at 20:31:34 UTC, Manu wrote:
>> 
>> If someone wants to fix shared (remove read/write access), 
>> that would
>> be absolutely mega!
>>
>
> I don't really use shared, so I'm confused by the "remove 
> read/write access". I thought the point of shared was to only 
> allow atomic read/write access.

 From what I gather it's to prevent using functions in the class 
that aren't marked with shared.

You can modify members that are shared for a struct:

struct A {
    int a;
    void setA(int v) shared {
        synchronized {
           a = v;
        }
    }
}

shared A a;
a.a = 10; // shouldn't be ok

This kind of defeats the purpose of shared, it can't guarantee 
that this is safe. It should prevent modifying the struct, except 
through functions marked as shared.

Seems Walter is against this though. I don't think anyone is 
going to waste their time on something that Walter already has a 
biased opinion against.




More information about the Digitalmars-d mailing list