lock-free Questions

2

Solved

Imagine a program with two threads. They are running the following code (CAS refers to Compare and Swap): // Visible to both threads static int test; // Run by thread A void foo() { // Check if ...
Ramiah asked 7/2, 2010 at 0:23

3

Solved

Does someone know of a good resource for the implementation (meaning source code) of lock-free usual data types. I'm thinking of Lists, Queues and so on? Locking implementations are extremely easy...

7

Solved

I have a question about the following code sample (m_value isn't volatile, and every thread runs on a separate processor) void Foo() // executed by thread #1, BEFORE Bar() is executed { Interlock...
Grattan asked 18/11, 2009 at 18:7

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 ...

4

Solved

x86 and other architectures provide special atomic instructions (lock, cmpxchg, etc.) that allow you to write 'lock free' data structures. But as more and more cores are added, it seems as though t...
Kimikokimitri asked 18/10, 2009 at 19:42

4

Solved

I've found several implementations for single producer-single consumer, but none for multiple producer-single consumer. Does a lock-free queue for "multiple producers-single consumer" exist for De...
Premeditate asked 5/7, 2009 at 11:54

4

Solved

Does anyone know if there are any lock-free container libraries available for .NET ? Preferably something that is proven to work and faster than the Synchronized wrappers we have in .NET. I have ...

1

Solved

for a simple pointer-increment allocator (do they have an official name?) I am looking for a lock-free algorithm. It seems trivial, but I'd like to get soem feedback whether my implementaiton is co...
Bellicose asked 28/8, 2009 at 20:57

2

Solved

I'm implementing a lock-free mechanism using atomic (double) compare and swap instructions e.g. cmpxchg16b I'm currently writing this in assembly and then linking it in. However, I wondered if th...
Funke asked 30/5, 2009 at 23:58

4

Solved

I'm running into a situation where I need the atomic sum of two values in memory. The code I inherited goes like this: int a = *MemoryLocationOne; memory_fence(); int b = *MemoryLocationTwo; retur...
Nerland asked 10/4, 2009 at 0:37

5

I am new to .net and would like to know whether .net has the java equivalent of AtomicInteger, ConcurrentLinkedQueue, etc? I did a bit of search and couldnt come up with anything. The lock free a...
Charette asked 29/11, 2008 at 8:46

8

When can 64-bit writes be guaranteed to be atomic, when programming in C on an Intel x86-based platform (in particular, an Intel-based Mac running MacOSX 10.4 using the Intel compiler)? For example...
Hyperphagia asked 16/9, 2008 at 23:16

© 2022 - 2024 — McMap. All rights reserved.