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.

learn more… | top users | synonyms

3
votes
0answers
99 views

Concurrent queue

I recently wrote a concurrent, mutex-less (but not lockfree) queue and wanted to know if it is actually correct, and if there are any particular improvements I could make: ...
6
votes
3answers
157 views

Is my below code thread safe w.r.t all the main application threads should get consistent data?

I am working on a project in which I construct a url with a valid hostname (but not a blocked hostname) and then execute that URL using RestTemplate from my main ...
7
votes
2answers
118 views

How to make sure all the threads are getting consistent data without performance impacts?

I am working on a project in which I construct a url with a valid hostname (but not a blocked hostname) and then execute that URL using RestTemplate from my main ...
3
votes
1answer
139 views

How to avoid making the call to the servers whenever it is down?

I am working on a project in which I construct a url with a valid hostname (but not a blocked hostname) and then execute that URL using RestTemplate from my main ...
2
votes
0answers
71 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
166 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 ...
10
votes
1answer
228 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 ...
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 ...
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 ...
7
votes
2answers
4k views

atomic_queue - thread-safe and lock-free implementation of the FIFO data structure pattern

please review my implementation of a FIFO data structure that guarantees thread-safe access without locking. I removed the license header block and all Doxygen comments. The original version (along ...
12
votes
2answers
731 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 ...