An umbrella term for methods and algorithms to synchronize multithreaded environments or other forms of distributed system without using locks.

learn more… | top users | synonyms

3
votes
1answer
86 views

Lock-free queue with doubly linked list correctness

I need a lock-free queue which is implemented by doubly linked list. Is my code correct? Are there any errors? Are there any improvements to be made? linkedlist.h ...
4
votes
1answer
89 views

Single consumer and single producer lock-free circular buffer

I'm pretty new to multithreading. The code below is a simple implementation of a single consumer/single producer circular buffer that does not use any locking, that I wrote for fun. The question ...
0
votes
0answers
37 views

Lock-Free interface to the user?

I'm working on a profiling library for C++. It is available here: CxxProf Github Project The interface to the user is a simple wrapper. Here's a part of CxxProfileStatic.cpp: ...
2
votes
0answers
69 views

(nearly) lock-free job queue of dynamic size (multiple read/write)

Warning: the code below is NOT multi read/write! It'l work fine as long as you don't have multiple writes OR don't require resize. But with multiple writers, the code can enter a deadlock state. I'm ...
5
votes
1answer
165 views

lock-free job queue without size restriction (multiple read/write)

I've since come up with an improved version, which isn't technically lock-free, but might be as close as you can get (nearly) lock-free job queue of dynamic size (multiple read/write) code below is ...
4
votes
1answer
131 views

Lockfree ThreadPool implementation

How could this template class ThreadPool be improved? I use Boost queue to keep std::function's numbers from ...
5
votes
1answer
72 views

CountdownLatch: Is this thread-safe?

I am trying to learn how to write correct lock-free code. I've written this class out of exercise for a synchronization construct to be used across multiple threads. The intent is to have worker ...
7
votes
1answer
217 views

Lockless Queue Multiple-Reader Singler-Writer in C++

I wrote a lockless queue for sending small objects from a single thread to a random worker thread. Assumptions: x86/x86_64 compiled with GCC one thread may Write(), multiple threads may Read() ...
10
votes
1answer
220 views

Play some sine waves with SDL2

Runs smoothly, however valgrind is showing "possibly lost: 544 bytes in 2 blocks". This is my first time doing a lot of things here so I might be making multiple mistakes. Please let me know if ...
6
votes
0answers
235 views

Low-lock Multi-threading Implementation

I'm designing in my spare time a game engine (for fun, not so much for profit, haha). I wanted to design the 'core pipeline' as efficiently as possible. Having a quad-core CPU, I decided to take ...
1
vote
0answers
92 views

Multi producer/consumers lockfree list

As per similar question Multi producer/consumers lockfree stack, following a lockfree list implementation. Note that this list is pre-defined maximum set of elements which can be inserted (N argument ...
6
votes
4answers
183 views

Valid and safe use of SpinLock in Singleton?

Is this a valid and safe use of .NET's System.Threading.SpinLock? Why am I doing this? Random's public methods are not ...
4
votes
2answers
527 views

Block a thread - spin-lock replacement

I have implemented several lock-free algorithms to maximise throughput but have always baulked when performing a spin-lock. I can usually convince myself that this is the only way but it still nags at ...
4
votes
1answer
227 views

Multi producer/consumers lockfree stack

Can you please take a look at the following x86-64 C++ code which should implement a multi consumer/produce lockfree stack? Do you think I have missed anything? ...
3
votes
0answers
61 views

Is throughput performance of lockfree stack in line with expectations?

As per subject, following a relatively simple C++/gcc/x86-64 implementation of a lockfree stack. I believe the ABA issue should have been fixed in the pop method too; following code for reference. Is ...
2
votes
1answer
74 views

Simple Freelock collection

I wrote simple lock-free collection class for saving items from multithreading code. I did it just for fun and experience. Can you check my code for potentially problems please? ...
5
votes
0answers
2k views

Lock-free multiple-consumer multiple-producer queue

The code below implements an intrusive lock-free queue that supports multiple concurrent producers and consumers. Some features: Producers and consumers work on separate ends of the queue most of ...
2
votes
1answer
176 views

Lock-free DoubleBufferedList

I posted this on SO and would appreciate any ideas on it's stability. Much like the old double-buffering algorithm, this uses a List<T> to which are added ...
1
vote
2answers
1k views

Lock-Free Ring Implementation

I am wondering if someone can take a look at my lock-free, circular ring implementation which I use to implement a background logger. The CircularRing ...
2
votes
1answer
602 views

Publisher/Consumer thread-safe lock-free queue with a single publisher/consumer

The code above is a implementation of a lock-free queue that makes the assumption that there is exactly one Consumer thread and one Producer thread. This works as intended? The memory barriers is used ...
6
votes
1answer
2k views

Thread-safe lock-free counter

I was using such code: ...
12
votes
2answers
730 views

O(1) lock free container?

I posted this code in answer to a question on SO and someone asked if it had been peer-reviewed. It had not so I thought you guys may be able to help. It is a lock-free ...
14
votes
2answers
762 views

Lock-free cache oblivious n-body algorithm

I'm currently looking at, from a rather high level, the parallelization of the gravity calculation in an N-body simulation for approximating a solution to the N-body problem. The simple form of the ...
26
votes
5answers
5k views

Is this (Lock-Free) Queue Implementation Thread-Safe?

I was trying to create a lock-free queue implementation in Java, mainly for personal learning. The queue should be a general one, allowing any number of readers and/or writers concurrently. Would you ...