I have a question about multithread share variable problem. the two variable is like: only one thread can modify the two variable, other thread wil ...
I have a question about multithread share variable problem. the two variable is like: only one thread can modify the two variable, other thread wil ...
I use posix_memalign() to alloc place to put my pointers, but when i try to free this place, it comes to this: *** Error in `/home/liqiaochu/lockless ...
There are three different types of "lock-free" algorithms. The definitions given in Concurrency in Action are: Obstruction-Free: If all other thre ...
Given: Can removing the call to std::atomic_thread_fence have any effect? If so is there a succinct example? Keeping in mind that other functions m ...
Given: Is it ever possible for f to return a value other than 10, assuming there is only one thread writing to x? This would obviously not be true ...
Code block may contain a lot of code, just take it as a unit. Is CodeBlockA CodeBlockB CodeBlockC always execute in serial? How lock achieve this? ...
When i run this program i get output as 10 which seems to be impossible for me. I'm running this on x86_64 core i3 ubuntu. If the output is 10, then ...
I am wondering which are the advantages of lock-free programming over spin lock? I think that when we do lock free programming using CAS mechanism in ...
On x86, atomic RMW instructions like lock add dword [rdi], 1 are implemented using cache locking on modern CPUs. So a cache line is locked for duratio ...
It seems like I should be able to implement a vector-type object that I can insert into and read from simultaneously like so: If there is space in ...
In my C++ game engine, I have a job system which utilizes worker threads to do various tasks. Threads are affinitized to each available core. Recently ...
I get the feeling this may be a very general and common situation for which a well-known no-lock solution exists. In a nutshell, I'm hoping there's a ...
I came across this old (GCC prior to 4.8.3 -- bug 60272) bug report https://gcc.gnu.org/ml/gcc-bugs/2014-02/msg01951.html . This is fixed now. But I h ...
I have a consumer thread that must never lock nor allocate memory, and a producer thread that can. I want to implement a two place circular buffer to ...
I am working on a program where, 2+ (gstreamer) boost:: threads and same number of boost:: threads of a dummy application are simultaneously using a q ...
I would like to cobble together a uint64 atomic counter from atomic uint32s. The counter has a single writer and multiple readers. The writer is a sig ...
I have been trying to Google my question but I honestly don't know how to succinctly state the question. Suppose I have two threads in a multi-core I ...
I came up with an idea I am trying to implement for a lock free stack that does not rely on reference counting to resolve the ABA problem, and also ha ...
I am trying to implement a thread-safe lockless container, analogous to std::vector, according to this https://software.intel.com/en-us/blogs/2008/07/ ...
Is there any way to detect whether a function or thread is blocking? I want to build a test case in which I can test whether a function is hard realti ...