On Saturday, 25 January 2014 at 23:20:47 UTC, Johannes Pfau wrote:
Yes, I came to the same conclusion. If we combine volatile
and shared into one qualifier we'll always have a certain
performance
hit.
This is what GDC does now.
Am Sat, 25 Jan 2014 21:48:39 +
schrieb "Kagamin" :
> Also if you read a shared value with atomicLoad every time, this
> disallows caching in registers or on stack, which is also
> performance hit. The shared value should be read once and cached
> if possible.
Yes, I came to the same conclu
Am Sat, 25 Jan 2014 21:41:20 +
schrieb "Kagamin" :
> On Saturday, 25 January 2014 at 10:00:58 UTC, Johannes Pfau wrote:
> > (For example it isn't valid in D to access a shared variable
> > with
> > normal operations anyway, AFAIK. You need to use the atomicOp
> > things
> > and these will th
Also if you read a shared value with atomicLoad every time, this
disallows caching in registers or on stack, which is also
performance hit. The shared value should be read once and cached
if possible.
On Saturday, 25 January 2014 at 10:00:58 UTC, Johannes Pfau wrote:
(For example it isn't valid in D to access a shared variable
with
normal operations anyway, AFAIK. You need to use the atomicOp
things
and these will the worry about the hardware part, using the
correct
instructions and so on)
Am Fri, 24 Jan 2014 22:30:13 +
schrieb "Kagamin" :
> http://igoro.com/archive/volatile-keyword-in-c-memory-model-explained/
> As I understand, because Itanium doesn't have cache coherency, a
> memory fence is needed to implement volatile load and store. On
> x86 load and store are already vo
http://igoro.com/archive/volatile-keyword-in-c-memory-model-explained/
As I understand, because Itanium doesn't have cache coherency, a
memory fence is needed to implement volatile load and store. On
x86 load and store are already volatile because of cache
coherency, so fences are not needed.
for example
http://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming
Am Thu, 23 Jan 2014 19:20:34 +
schrieb "Kagamin" :
> A minor caveat is GDC treats shared as volatile, which can be not
> optimal. Even worse, on some platforms like itanium volatile
> generates fences.
Do you have more information on that issue?
There are claims that Itanium "automatically
A minor caveat is GDC treats shared as volatile, which can be not
optimal. Even worse, on some platforms like itanium volatile
generates fences.
The compiler does not do this for you, because it can not know
if accessing any member is truly thread-safe. You might share
the logFile with other instances of Foo. This would be a case
where the compiler would wrongly remove the shared from this,
if it would do so automatically inside synchro
Am 22.01.2014 06:16, schrieb unknown soldier:
I'm confused by shared and how to use it.
import std.stdio;
class Foo {
File logFile;
void log(in string line) shared {
synchronized(this){
logFile.writeln(line);
}
}
}
This (or the equivalent code in my full si
12 matches
Mail list logo