interlocked Questions

4

I am confused that Microsoft says memory alignment is required for InterlockedExchange however, Intel documentation says that memory alignment is not required for LOCK. Am i missing something, or w...
Pantelleria asked 19/5, 2009 at 9:34

2

Solved

Is there any way to implement a type of reference whose value can be exchanged with another atomically? In Java we have AtomicReference which can be swapped with a local variable but not with an...
Graaf asked 25/1, 2011 at 21:31

1

Solved

I have some code which must be thread safe whose behavior resembles this: protected long m_RunningValue protected long m_RunningCounter protected object m_Lock = new object(); public long Runni...
Studding asked 7/12, 2010 at 23:28

5

Solved

I've been using C# for a while, and have recently started working on adding parallelism to a side project of mine. So, according to Microsoft, reads and writes to ints and even floats are atomic I...
Fifield asked 29/9, 2010 at 19:4

2

Solved

I've been reading the answer to a similar question, but I'm still a little confused... Abel had a great answer, but this is the part that I'm unsure about: ...declaring a variable volatile makes...
Tapeworm asked 19/3, 2010 at 5:48

3

Solved

Disclaimer: My posts are apparently always verbose. If you happen to know the answer to the title question, feel free to just answer it without reading my extended discussion below. The System.T...
Retroflex asked 11/2, 2010 at 1:6

4

Solved

I've written a low lock list in C++ on windows 32-bit. I'm getting BIG improvements over using critical sections but I'd like someone to sanity check that what I'm doing is correct and there aren't...
Meteoroid asked 11/12, 2009 at 16:24

5

Solved

In other words, can I do something with a volatile variable that could not also be solved with a normal variable and the Interlocked class?
Decretal asked 9/11, 2009 at 14:15

2

Solved

Two Windows processes have memory mapped the same shared file. If the file consists of counters, is it appropriate to use the Interlocked* functions (like InterlockedIncrement) to update those coun...
Antofagasta asked 28/10, 2009 at 14:44

2

I'm just wondering whether this code that a fellow developer (who has since left) is OK, I think he wanted to avoid putting a lock. Is there a performance difference between this and just using a s...
Yevetteyew asked 7/9, 2009 at 13:27

3

Win32 api has a set of InterlockedXXX functions to atomically and synchronously manipulate simple variables, however there doesn't seem to be any InterlockedRead function, to simply retrive the val...
Kerchief asked 5/7, 2009 at 18:33

4

Solved

While reading about the function InterlockedIncrement I saw the remark that the variable passed must be aligned on a 32-bit boundary. Normally I have seen the code which uses the InterlockedIncreme...
Palsgrave asked 5/3, 2009 at 17:9

© 2022 - 2024 — McMap. All rights reserved.