memory-fences Questions

2

Solved

Like many other people, I've always been confused by volatile reads/writes and fences. So now I'm trying to fully understand what these do. So, a volatile read is supposed to (1) exhibit acquire-s...
Limner asked 8/2, 2014 at 23:10

1

Solved

We know that making fields final is usually a good idea as we gain thread-safety and immutability which makes the code easier to reason about. I'm curious if there's an associated performance cost....
Altonaltona asked 7/5, 2014 at 20:0

2

Solved

The notion of a compiler fence often comes up when I'm reading about memory models, barriers, ordering, atomics, etc., but normally it's in the context of also being paired with a CPU fence, as one...
Pechora asked 26/8, 2013 at 17:7

3

Solved

Even for a simple 2-thread communication example, I have difficulty to express this in the C11 atomic and memory_fence style to obtain proper memory ordering: shared data: volatile int flag, buck...
Townie asked 30/10, 2013 at 17:29

3

Solved

In his Blog Herb Sutter writes [...] because incrementing the smart pointer reference count can usually be optimized to be the same as an ordinary increment in an optimized shared_ptr impleme...
Duration asked 6/6, 2013 at 15:23

1

Solved

I have heard that when dealing with mutexes, the necessary memory barriers are handled by the pthread API itself. I would like to have more details on this matter. Are these claimings true, at le...
Quinacrine asked 12/6, 2012 at 13:23

4

Solved

I have a set and test xchg based assembly lock. my question is : Do we need to use memory fencing (mfence, sfence or lfence ) when using xchg instruction ? Edit : 64 Bit platform : with Intel...
Foam asked 27/1, 2012 at 0:41

5

Solved

There are a couple of questions on this site asking whether using a volatile variable for atomic / multithreaded access is possible: See here, here, or here for example. Now, the C(++) standard co...
Insolation asked 10/8, 2011 at 7:42

1

Solved

I'm thinking of whether or not it is possible for atomic variable to load the old value in acquire-release pair. Let's suppose we have atomic variable x, and we store that variable with release sem...
Replenish asked 14/12, 2010 at 18:45

4

Solved

I'm experimenting with C++0x support and there is a problem, that I guess shouldn't be there. Either I don't understand the subject or gcc has a bug. I have the following code, initially x and y a...
Incontestable asked 25/10, 2010 at 5:48

1

Solved

I'm reading Memory Barriers by Paul E. McKenney http://www.rdrop.com/users/paulmck/scalability/paper/whymb.2010.07.23a.pdf everything is explained in great details and when I see that everything is...
Dantedanton asked 22/10, 2010 at 17:41

3

Solved

I know that the .NET memory model (on the .NET Framework; not compact/micro/silverlight/mono/xna/what-have-you) guaranteed that for certain types (most notably primitive integers and references) op...

4

Solved

When I write a value into a field, what guarantees do I get regarding when the new value will be saved in the main memory? For example, how do I know that the processor don't keep the new value in ...

© 2022 - 2024 — McMap. All rights reserved.