lock-free Questions
1
Solved
Reading a bit about lock free programming in the past few days I came across the util.java.Random class creating it's bits using the following routine:
protected int next(int bits) {
long oldseed,...
Arlie asked 14/9, 2018 at 19:3
5
Solved
Is there any C++ implementation (source codes) of "optmistic approach to lock-free FIFO queues" algorithm?
Hypnotic asked 31/5, 2010 at 18:26
1
Solved
Boost.Interprocess is a wonderful library that simplifies the usage of shared memory amongst different processes. It provides mutexes, condition variables, and semaphores, which allow for synchroni...
Oomph asked 22/7, 2018 at 8:28
6
Solved
I'm attempting to write a lock-free version of a call queue I use for message passing. This is not for anything serious, just to learn about threading.
I'm relatively sure my code is correct, exce...
Moneylender asked 30/5, 2009 at 6:15
4
Solved
I understand the ABA problem. But the thing which I am unable to comprehend is: they say that in languages having automatic garbage collection it may not exhibit. So my questions are:
How automat...
Transcendentalistic asked 29/10, 2013 at 14:15
1
I am looking for a lock-free way to signal between two Asyncs in F#. I have two tail-recursive async functions, and I want one to yield until signaled by the other before proceeding to the next rec...
9
Solved
I'm writing a program with a consumer thread and a producer thread, now it seems queue synchronization is a big overhead in the program, and I looked for some lock free queue implementations, but o...
Aurar asked 13/6, 2009 at 12:57
2
Solved
Since std::atomic::is_lock_free() may not genuinely reflect the reality [ref], I'm considering writing a genuine runtime test instead. However, when I got down to it, I found that it's not a trivia...
Spasmodic asked 16/4, 2018 at 2:19
1
Solved
Previously, with Apple LLVM 9.1.0, is_lock_free() on 128-bit structures have returned true. To have complete std::optional support, I then upgraded to MacPorts gcc 7.3. During my first try to compi...
1
Solved
Why is std::atomic's store:
std::atomic<int> my_atomic;
my_atomic.store(1, std::memory_order_seq_cst);
doing an xchg when a store with sequential consistency is requested?
Shouldn't, te...
2
Solved
Let's assume that 2 cores are trying to write different values to the same RAM address (1 byte), at the same moment of time (plus-minus eta), and without using any interlocked instructions or memor...
Doralia asked 15/2, 2018 at 22:1
1
Solved
In the book C++ Concurrency in Action, the author gave an example of using hazard pointer to implement a lock-free stack data structure. Part of the code is as follows:
std::shared_ptr<T> po...
Bedell asked 14/2, 2018 at 9:26
15
I ve been googling quite a bit for a lock-free queue in C++. I found some code and some trials - but nothing that i was able to compile. A lock-free hash would also be welcome.
SUMMARY:
So f...
1
Solved
2
Solved
I've encountered an issue with memory reclamation in crossbeam. Say you're implementing a simple thread-safe lock-free container that holds a single value. Any thread can obtain a clone of the stor...
5
Solved
I am looking for some reference on average latencies for lock cmpxchg instruction for various intel processors. I am not able to locate any good reference on the topic and any reference would gre...
Yardarm asked 15/11, 2010 at 19:14
2
Solved
So i'm using a boost::lockfree::spec_queue to communicate via two boost_threads running functors of two objects in my application.
All is fine except for the fact that the spec_queue::pop() method...
Cyma asked 18/3, 2014 at 17:21
3
Solved
The Intel documentation says
This instruction can be used with a LOCK prefix to allow the instruction to be executed atomically.
My question is
Can CMPXCHG operate with memory address? From the ...
Nagoya asked 8/1, 2015 at 10:20
1
Solved
Ive discovered a really strange behaviour with std::shared_ptr in c++.
The following example works perfectly with standard pointers.
However the usage of std::shared_ptr causes here a segmentation...
Errand asked 24/5, 2017 at 14:4
4
Solved
I get that at the assembly language level instruction set architectures provide compare and swap and similar operations. However, I don't understand how the chip is able to provide these guarantees...
Adnate asked 7/2, 2013 at 18:13
3
Solved
One popular solution to the ABA problem in lock-free data structures is to tag pointers with an additional monotonically incrementing tag.
struct aba {
void *ptr;
uint32_t tag;
};
However, t...
Appointment asked 28/2, 2017 at 16:58
5
Solved
How could I implement this lock-free queue pseudocode in C?
ENQUEUE(x)
q ← new record
q^.value ← x
q^.next ← NULL
repeat
p ← tail
succ ← COMPARE&SWAP(p^.next, NULL, q)
if succ ≠ TRUE
C...
1
I'm studying the various types of memory reclamation strategies for lock-free data structures in a non-garbage collected environment (like C or C++).
In my experiments, I've implemented a few of t...
Jellyfish asked 12/4, 2016 at 12:31
1
Solved
I am a little bit confused about the two concepts.
definition of lock-free on wiki:
A non-blocking algorithm is lock-free if there is guaranteed
system-wide progress
definition of non-blocki...
Yarmouth asked 14/12, 2016 at 15:40
2
Solved
I want to find out if the std::call_once lock free. There are call_once implementations using mutex. But why should we use mutex? I tried to write simple implementation using atomic_bool and CAS op...
Filiate asked 20/11, 2016 at 17:34
© 2022 - 2024 — McMap. All rights reserved.