lock-free Questions

2

I would like to create a class with two methods: void SetValue(T value) stores a value, but only allows storing a single value (otherwise it throws an exception). T GetValue() retrieves the value...
Emelda asked 21/2, 2013 at 14:44

1

Solved

I have a problem with placing boost::lockfree::queue<<T, fixed_sized<false>, ..> in shared memory. I need it because I have to be able to insert more than 65535 messages into the que...
Reefer asked 15/2, 2013 at 11:1

1

Solved

I am reading C++ Concurrency in Action by Anthony Williams. At section "Understanding Relaxed Ordering" it has: There are a few additional things you can tell the man in the cubicle, such as “wr...
Wilbur asked 10/2, 2013 at 5:49

5

Solved

We've been looking to use a lock-free queue in our code to reduce lock contention between a single producer and consumer in our current implementation. There are plenty of queue implementations out...
Condor asked 23/6, 2011 at 22:14

1

Solved

I read FutureTask class in jsr166, found that outcome object is non-volatile, the comments in code is "non-volatile, protected by state reads/writes" line 75, the state is volatile int. I have read...
Erme asked 21/1, 2013 at 4:8

8

It is easy to set memory barriers on the kernel side: the macros mb, wmb, rmb, etc. are always in place thanks to the Linux kernel headers. How to accomplish this on the user side?
Completion asked 26/7, 2009 at 17:25

8

Solved

If I have a deeply immutable type (all members are readonly and if they are reference type members, then they also refer to objects that are deeply immutable). I would like to implement a lazy init...
Warrantable asked 16/3, 2009 at 21:21

2

Solved

What is the point in replacing a mutex lock with block like this void stack_push(stack* s, node* n) { node* head; do { head = s->head; n->next = head; } while ( ! atomic_compare_excha...
Blenny asked 20/9, 2012 at 15:25

1

I recently read Paul McKenney's 2010 white paper, "Memory Barriers: a Hardware View for Software Hackers". I would very much appreciate some feedback / comments / guidance with regard to a small s...
Inapprehensive asked 10/9, 2012 at 9:14

2

Solved

I am looking for a ring buffer implementation (or pseudocode) in C with the following characteristics: multiple producer single consumer pattern (MPSC) consumer blocks on empty producers block on...

4

Solved

The more I read the more confused I become... I would have thought it trivial to find a formally correct MPSC queue implemented in C++. Every time I find another stab at it, further research ...
Rogation asked 18/1, 2012 at 22:23

2

Solved

First result in Google for "lock free vector" is a research paper cowritten by Damian Dechev, Peter Pirkelbauer and Bjarne Stroustrup describing a theoretical lock-free vector. Has this, or any oth...
Cat asked 21/2, 2012 at 22:5

3

Solved

I'm currently looking at a copy-on-write set implementation and want to confirm it's thread safe. I'm fairly sure the only way it might not be is if the compiler is allowed to reorder statements wi...
Woodsum asked 6/7, 2012 at 7:7

2

I'm progressing in my Clojure quest (about 80 problems solved on 4clojure.com) and I keep on reading and coding and trying to "get it". Now I'm a bit confused by Clojure being designed for "lockle...
Attainment asked 14/6, 2012 at 11:14

2

Solved

I'm working on the next release of my lock-free data structure library, using LL/SC on ARM. For my use-case of LL/SC, I need to use it with a single STR between the LDREX and STREX. (Rather than us...

6

Solved

I was reading through an answer that Jon Skeet gave to a question and in it he mentioned this: As far as I'm concerned, lock-free multi-threading is for real threading experts, of which I'm not ...
Inheritrix asked 27/3, 2010 at 10:50

4

Solved

In order to assess whether go is a possible option for an audio/video application, I would like to know whether message passing in go satisfies any non-blocking progress guarantees (being obstructi...
Vicechairman asked 17/7, 2011 at 19:18

2

I use <thread> <atomic> <mutex> etc heavily in my code, which includes several lock-free algorithms. I am targeting (eventually) a linux environment. I've been developing with the...
Eulaeulachon asked 7/4, 2012 at 15:41

2

I have a pair of unsigned int32 std::atomic<u32> _start; std::atomic<u32> _end; Sometimes I want to set start or end with compare exchange, so I don't want spurious failures that cou...
Danelledanete asked 13/1, 2012 at 22:55

2

Solved

I need to read/write 16 bytes atomically. I do the writing only using cmpxchg16, which is available on all x64 processors except I think for one obscure AMD one. Now the question is for aligned 16...
Alisonalissa asked 15/3, 2012 at 19:15

7

I've seen some lock free implementations of stack... My question is regarding the visibility, not atomicity. For example do elements(not pointers) of lock free stack must be at most 64bit? I think ...
Krp asked 28/9, 2011 at 11:31

3

Solved

My question is related to multithreading lock-free synchronization. I wanted to know the following: What are general approaches to achieve this? I read somewhere about LockFreePrimitives like Com...
Interfertile asked 1/2, 2012 at 21:40

5

Solved

From what I gathered on the lock free programming, it is incredibly hard to do right... and I agree. Just thinking about some problems makes my head hurt. But what I wonder is, why isn't there a ...
Donniedonnish asked 6/12, 2011 at 12:48

2

Solved

I am sharing some data across multiple processes by using shared memory; I use inter processes mutexes to achieve synchronization. My question is the following: is it possible to use lock-free da...
Turbine asked 16/11, 2011 at 23:44

4

I develop some lock free data structure and following problem arises. I have writer thread that creates objects on heap and wraps them in smart pointer with reference counter. I also have a lot of...
Ezara asked 4/11, 2011 at 9:30

© 2022 - 2024 — McMap. All rights reserved.