lock-free Questions
2
Solved
I'm reading C++ Concurrency in Action by Anthony Williams, and don't understand its push implementation of the lock_free_stack class.
Why on earth the atomic load is not in the while loop ? The re...
1
Solved
I was using AtomicReference to implement AtomicInteger. However while in testing I notice even in single threaded environment the CAS operation got stuck once its value hit 128.. Am I doing somethi...
Contempt asked 13/6, 2014 at 16:11
3
I am writing a lock-free doubly linked list based on these papers:
"Efficient and Reliable Lock-Free Memory Reclamation Based on Reference Counting"
Anders Gidenstam,Member, IEEE,Marina Papatriant...
Arletha asked 26/10, 2013 at 17:4
1
Solved
I have two versions of spinlock below. The first uses the default which is memory_order_cst while the latter uses memory_order_acquire/memory_order_release. Since the latter is more relaxed, I expe...
Gillenwater asked 7/5, 2014 at 15:28
2
Solved
What tools exist to help one to experiment with weakly ordered concurrency? That is, in what sandbox can one play while teaching oneself about partial fences, weak atomics, acquire/consume/release ...
Barth asked 4/1, 2013 at 16:34
3
Solved
I'm trying to put std::strings into boost::lockfree::queues so that my threads can update each other with new data.
When I try to use boost::lockfree::queue<std::string> updated_data;, g++ s...
2
Solved
Are the following operations lockfree for std::unique_ptr and/or std::shared_ptr?
Dereferencing, i.e. read(*myPtr) or myPtr->getSomething()
Removing a reference, i.e. with std::move(myUniquePt...
Archenemy asked 8/4, 2014 at 3:36
1
Solved
Consider the following scenario:
Requirements:
Intel x64 Server (multiple CPU-sockets => NUMA)
Ubuntu 12, GCC 4.6
Two processes sharing large amounts of data over (named) shared-memory
Classical...
Emanation asked 5/3, 2014 at 19:39
3
So, I've written a queue, after a bit of research. It uses a fixed-size buffer, so it's a circular queue. It has to be thread-safe, and I've tried to make it lock-free. I'd like to know what's wron...
Herron asked 4/2, 2014 at 19:4
2
Solved
I've produced a simple implementation of the lockless (lockfree) queue using the new std::atomic in C++11. I can't see what I'm doing wrong here.
#include <atomic>
template<typename T>...
Sophy asked 20/12, 2013 at 18:57
5
Solved
Say I have a large array and I want to process the contents with multiple threads. If I delegate each thread to a specific section, guaranteeing no overlap, does that eliminate any need for locking...
Strafford asked 12/12, 2013 at 16:14
5
Solved
In theory, it should be possible to at least brute force a verification of a lock-free algorithm (there are only so many combinations of function calls intersecting). Are there any tools or formal ...
Waterresistant asked 15/1, 2010 at 13:43
2
I am reading some paper for lock-free doubly linked list.
In these papers, they store an address to next and prev node and a flag in one word(int).
Is it because in 32-bit architectures all addres...
3
Solved
I have a problem with the MS C compiler reordering certain statements, critical in a multithreading context, at high levels of optimization. I want to know how to force ordering in specific places ...
Firdausi asked 10/10, 2013 at 9:32
3
I am reading C++ Concurrency in Action by Anthony Williams. Currently I at point where he desribes memory_order_consume.
After that block there is:
Now that I’ve covered the basics of the memor...
Foretopmast asked 8/2, 2013 at 19:0
2
Solved
I'm trying to substitute boost::lockfree::queue for std::queue in this websocket++ example https://github.com/zaphoyd/websocketpp/blob/experimental/examples/broadcast_server/broadcast_server.cpp
I...
1
Solved
Why is the boost lockfree size is fixed to 65535 objects?
typedef boost::lockfree::queue<int, boost::lockfree::fixed_size<true>> MyQueue;
MyQueue queue(1024*100);
The above code thro...
3
I wrote some lock-free code that works fine with local
reads, under most conditions.
Does local spinning on a memory read necessarily imply I
have to ALWAYS insert a memory barrier before the spin...
Aromaticity asked 25/7, 2011 at 0:31
3
Solved
On Intel, the arguments to CMPXCHG must be cache line aligned (since Intel uses MESI to implement CAS).
On ARM, ldrex and strex operate on exclusive reservation granuales.
To be clear, does this ...
1
.Net framework has Interlocked.Add() methods only for int and long. But I need Interlock.Add() for double type. How can I do that?
3
I try to use a ForkJoinPool to parallelize my CPU intensive calculations.
My understanding of a ForkJoinPool is, that it continues to work as long as any task is available to be executed. Unfortun...
Gladysglagolitic asked 3/6, 2013 at 10:44
1
Solved
I'm trying to write a lock free singly linked list. Eventual consistency is not a problem (someone traversing a list which might contain incorrect items).
I think that I got the add item right (lo...
Anecdotist asked 31/5, 2013 at 17:52
1
I'm solving two feeds arbitrate problem of FAST protocol.
Please don't worry if you not familar with it, my question is pretty general actually. But i'm adding problem description for those who int...
Baez asked 24/4, 2013 at 21:23
3
Solved
What is the cost of the atomic operation (any of compare-and-swap or atomic add/decrement)? How much cycles does it consume? Will it pause other processors on SMP or NUMA, or will it block memory a...
Inshrine asked 29/3, 2010 at 13:11
2
Solved
Considering my lack of c++ knowledge, please try to read my intent and not my poor technical question.
This is the backbone of my program https://github.com/zaphoyd/websocketpp/blob/experimental/e...
Mooch asked 11/3, 2013 at 2:15
© 2022 - 2024 — McMap. All rights reserved.