On Saturday, 19 September 2015 at 19:17:38 UTC, Daniel Kozak wrote:
No, collection could not occure if we speaking about current D GC
implementation. So it safe to set pointer before addRoot.


It can be triggered by another thread.

Wrong:

ptr = somestack.pop();
someglobalptr = ptr;
// ptr register flushed
// collection triggered by other thread
// other thread allocated the same memory for some other object
addRoot(ptr);

Right:

ptr = somestack.pop();
addRoot(ptr);
ensure memory barrier here;
someglobalptr = ptr;

?

        • Re: Go 1.5 deadalnix via Digitalmars-d-announce
        • Re: Go 1.5 Ola Fosheim Grøstad via Digitalmars-d-announce
  • Re: Go 1.5 Ola Fosheim Grøstad via Digitalmars-d-announce
  • Re: Go 1.5 thedeemon via Digitalmars-d-announce
    • Re: Go 1.5 Ola Fosheim Grøstad via Digitalmars-d-announce
      • Re: Go 1.5 thedeemon via Digitalmars-d-announce
        • Re: Go 1.5 Ola Fosheim Grøstad via Digitalmars-d-announce
          • Re: Go 1.... Ola Fosheim Grøstad via Digitalmars-d-announce
            • Re: ... Daniel Kozak via Digitalmars-d-announce
            • Re: ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Ola Fosheim Grøstad via Digitalmars-d-announce
              • ... Daniel Kozak via Digitalmars-d-announce
        • Re: Go 1.5 Robert M. Münch via Digitalmars-d-announce
    • Re: Go 1.5 Rory McGuire via Digitalmars-d-announce
    • Re: Go 1.5 Ola Fosheim Grøstad via Digitalmars-d-announce
  • Re: Go 1.5 Chris via Digitalmars-d-announce
    • Re: Go 1.5 Ola Fosheim Grøstad via Digitalmars-d-announce
      • Re: Go 1.5 Chris via Digitalmars-d-announce
        • Re: Go 1.5 Ola Fosheim Grøstad via Digitalmars-d-announce
        • Re: Go 1.5 ZombineDev via Digitalmars-d-announce

Reply via email to