Skip to main content

Questions tagged [atomic]

An atomic operation is one which can be considered, from the perspective of the computing context in which it occurs, to be executed in a single step. Atomic operations either succeed entirely or fail, with no intermediate states.

4 votes
3 answers
518 views

C11 zero copy lock-free triple buffer

The code is for a single producer, single consumer scenario, where the consumer only cares about the latest information shared by the producer. This is just a simple proof of concept created for linux....
mausys's user avatar
  • 49
0 votes
1 answer
144 views

C++ slim condition notifier

When writing multi-threading code, one often need the thread to wait for some condition being met. A naive approach would look like this: ...
zwhconst's user avatar
  • 137
1 vote
1 answer
323 views

Lock Guard Atomic alternative

I've recently written a Vulkan library for creating 2D applications with ease. The catch was I need std::lock_guard for my window resize event to resize resources ...
FatalSleep's user avatar
1 vote
1 answer
152 views

Implementation of a lock free queue using CompareAndSwap in Go

Here is my implementation of a lock free queue using CompareAndSwap operation. ...
Tauseef Ahmad's user avatar
3 votes
2 answers
293 views

atomic spinlock mutex class

This here is the follow-up to this question. I was recommended to implement a Lockable type (similar to std::mutex) that can work with ...
digito_evo's user avatar
8 votes
3 answers
2k views

Basic RAII spinlock class

I have written the following class that acts as a simple lock for mutual exclusion: ...
digito_evo's user avatar
1 vote
1 answer
203 views

Lock-free implementation of getAndUpdate() using atomic CAS (Compare-And-Swap) operation

We have the following class written in Kotlin Native with the new Memory Manager (which doesn't require to freeze objects): ...
Volo's user avatar
  • 111
4 votes
2 answers
2k views

Mutually exclusive execution using std::atomic?

I am currently learning more about lock free programming and wondered how I could implement mutual exclusion using std::atomics. I implemented the following code to ...
dvnlo's user avatar
  • 155
0 votes
1 answer
323 views

Flippable atomic boolean

I was trying to implement a boolean that can be atomically flipped. The suggestion on Stack Overflow is to use an integer. This would be my implementation. ...
Antonio's user avatar
  • 133
3 votes
2 answers
459 views

C++11 revised `std::latch` implementation

This question follows up on this question. After turning the while-loop into a conditional wait using std::condition_variable, I ...
noes's user avatar
  • 43
1 vote
1 answer
451 views

Implementation of a latch

As an exercise to learn more about multi-threading and atomic operations work in C++, I decided to implement a latch class in C++11 loosely based off of std::latch ...
noes's user avatar
  • 43
22 votes
3 answers
7k views

C++ lock-free, MPMC Ring buffer in C++20

I have some performance critical inter-thread messaging code in C++. Multiple producers, one or more consumers. Profiling dozens of iterations of this messaging code over several years of development, ...
Ash's user avatar
  • 364
6 votes
1 answer
1k views

Implementation of std::atomic<std::shared_ptr<T>> for C++20

As you may know, C++20 has added std::atomic<std::shared_ptr<T>> specialization to the standard, but sadly, most compilers have not implemented it yet. ...
Afshin's user avatar
  • 295
1 vote
1 answer
578 views

GLSL atomic float add for architectures with out atomic float add

...
Krupip's user avatar
  • 641
3 votes
2 answers
430 views

A toy example of the concurrent stack via atomic variables and CAS pattern

I've written a toy example of the concurrent stack which has only three functions push(), peek(), and ...
user37014's user avatar

15 30 50 per page
1
2 3 4 5