"shared" status

Zardoz luis.panadero at gmail.com
Mon Apr 16 03:57:54 PDT 2012


El Sun, 15 Apr 2012 23:05:55 +0200, Kapps escribió:

> On Saturday, 14 April 2012 at 10:48:16 UTC, Luis Panadero Guardeño
> wrote:
>> What is the status of "shared" types ?
>>
>> I try it with gdmd v4.6.3
>> And I not get any warring/error when I do anything over a shared
>> variable
>> without using atomicOp. It's normal ?
>>
>> shared ushort ram[ram_size];
>> ....
>> ....
>> ram[i] = cast(ushort) (bytes[0] | bytes[1] << 8);
> 
> Shared is at the moment (in my opinion anyways) not useable. Very little
> in Phobos is shared friendly. Most benefits of shared aren't implemented
> yet. I personally avoid it.

So, if I need to share a array of 0x10000 elements between 3 or more 
threads, how should do it ?


More information about the Digitalmars-d-learn mailing list