On Friday, 11 September 2015 at 17:29:47 UTC, Prudence wrote:
I don't care about "maybe" working. Since the array is hidden inside a class I can control who and how it is used and deal with the race conditions.

Looks like destruction slipped out of your control. That is solved by making array an instance member of wrapper singleton, then you will control its lifetime:

class MySharedArrayWrapper
{
    private Array!(int) a;

}

and instead I use

static shared MySharedArrayWrapper;

You will have one static instance of wrapper and it will have one instance of the array.
              • Re:... Jonathan M Davis via Digitalmars-d-learn
              • Re:... Ola Fosheim Grostad via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Prudence via Digitalmars-d-learn
              • Re:... Jonathan M Davis via Digitalmars-d-learn
              • Re:... Jonathan M Davis via Digitalmars-d-learn
              • Re:... Ola Fosheim Grøstad via Digitalmars-d-learn
              • Re:... Laeeth Isharc via Digitalmars-d-learn
              • Re:... Laeeth Isharc via Digitalmars-d-learn
              • Re:... Laeeth Isharc via Digitalmars-d-learn
          • Re: shared a... Kagamin via Digitalmars-d-learn
  • Re: shared array? Kagamin via Digitalmars-d-learn

Reply via email to