<html>
<head>
<base href="http://bugzilla.gdcproject.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Add support for attribute to mark data as volatile."
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=126#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Add support for attribute to mark data as volatile."
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=126">bug 126</a>
from <span class="vcard"><a class="email" href="mailto:johannespfau@gmail.com" title="Johannes Pfau <johannespfau@gmail.com>"> <span class="fn">Johannes Pfau</span></a>
</span></b>
<pre>Yes, I was eagerly waiting for that talk. Unfortunately the most interesting
talks are the last ones on each day and I couldn't watch these live because of
timezone stuff. I'll watch these as soon as recordings are available though,
especially your debugging talk.
Unfortunately I won't have the DIP finished during dconf, some difficult cases
are not discussed yet and the rationale is missing completely and the DIP is
not very useful without a rationale. But if you read this during dconf there's
one thing you could ask Andrei (or everybody):
Quoting Bartosz Milewski from <a href="http://stackoverflow.com/a/8833218/471401">http://stackoverflow.com/a/8833218/471401</a>
<span class="quote">> I's still struggling with the use of volatile with atomics: "volatile is
> completely unnecessary when used with std::atomic". What about the loop
> optimization of while(x.load(memory_order_relaxed)) ; => bool tmp =
> x.load(memory_order_relaxed); while(tmp) ; The standard is wishy washy about
> this and Hans turns into a diplomat when asked this question directly ;-)</span >
So translating this to D:
------------
import core.atomic;
shared bool x;
void main()
{
while(atomicLoad(x))
{
}
}
void main_optimized()
{
bool tmp = atomicLoad(x);
while(tmp)
{
}
}
------------
<a href="http://dpaste.dzfl.pl/b7ecc943ccab">http://dpaste.dzfl.pl/b7ecc943ccab</a>
Is optimizing main into main_optimized legal or not? The background of this
question is that merging reads is usually legal for atomic loads from
non-volatile memory (as-if rule). But in this case with a loop this is not
useful behavior. The question then is where to draw the line.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>