D1.5 anyone?

Walter Bright newshound2 at digitalmars.com
Wed Apr 12 07:27:00 UTC 2023


On 4/12/2023 12:11 AM, Richard (Rikki) Andrew Cattermole wrote:
> Unless proven otherwise, all memory is owned by the process not the thread and 
> therefore is the default.

Let's see if I understand:

     int abc(int* p);

     int sum(int[] a)
     {
         int sum = 0;
         abc(&sum);
         for (int i = 0; i < a.length; ++i)
             sum += a[i];
         return sum;
     }

Your position is that `i` and `sum` should be shared variables? What if 
`abc(&sum)` passes `&sum` to a concurrent thread?


More information about the Digitalmars-d mailing list