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

-1
votes
0answers
40 views

Lock-Free self-organizing list

I have created a lock-free self organizing list with transpose method using the java.util.concurrent.atomic.AtomicStampedReference. The operations are working as ...
3
votes
1answer
58 views

Async safe threadpool

I'm trying the write a threadpool that can safely be added inside a signal handler or in code forked by multithreaded code. Are there any corner cases that would cause this code to fail? What could be ...
10
votes
1answer
110 views

Copyable Atomic

I find it pretty annoying that c++11 atomics can't be copied. The reasons for this have been discussed e.g. here and I don't want to argue about them now. However, I find myself repeatedly in ...
2
votes
0answers
74 views

Controller method to add a product, stored across three database tables

I have some questions on how I can improve this "add" action method in a controller. Using a single form, the user can upload a product to be displayed on the site. A Product is composed of three ...
3
votes
2answers
45 views

Single reader - multiple writer waitable lock-free unreliably ordered stack

The main body of code is located here. In the code linted_error is a platform specific type for error codes. As well, as an optimization the code can use Linux ...
5
votes
1answer
61 views

Lock implementation using atomics

I was recently given an interview and was asked to write my own lock implementation using atomics, but not necessary reentrant. I didn't answer the question, but at home, I wrote this code. Please ...
7
votes
1answer
83 views

Fast non-fair semaphore

This is a simple non-fair semaphore implementation using Java atomic objects. It currently performs a little over twice as fast as java.util.concurrent.Semaphore on ...
3
votes
3answers
104 views

SPSC Wait Free Ring Buffer for incoming messages

This is for a single producer and single consumer wait free ring buffer. The writes need to be wait free for sure. It pre-allocates messages slots and uses a claim strategy to capture a buffer for ...
2
votes
1answer
47 views

Unreliable shared memory circular buffer with read-only consumer

This code is slightly platform dependent but should be pretty easy to port. The goal with this code was to create a circular buffer where the consumer could be limited to read-only access of the ...
3
votes
1answer
92 views

Transaction.atomic with continuations

I have a view that looks like this: ...
4
votes
1answer
46 views

Adding hostname to block list after x consecutive failures in multithreading application

I am using Callable in my code which will be called by multiple threads as shown below. Given a user id in DataKey object, I will find out what are the ...
4
votes
1answer
669 views

Lockless multi user, multi consumer FIFO queue using C++11

One of the features that is missing from C++11 are lockless queues. Therefore I have decided to write one myself. A few remarks: I know the code isn't technically lockless. However the lock is only ...
6
votes
1answer
395 views

C++ concurrency library

I started a C++11 library of concurrency primitives in order to study and compare their performance; provide high-quality implementation of those to use in my projects. Its main target platform is ...
4
votes
1answer
776 views

Lock-free ringbuffer with multiple readers in C++11

Basic Info I needed a lock-free ringbuffer with multiple readers (but one writer). However, I did not want the writer to check all readers every time in order to prevent an overrun. Thus, I decided ...
6
votes
1answer
209 views

General Batched Job Runner

This question is inspired by: Generic Task Scheduler where the problem is to run tasks on a scheduled basis, in parallel, and have individual timeouts for each job. For example, consider this ...
7
votes
3answers
294 views

Having full atomicity against all the threads without impacting performance or throughputs

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 ...
11
votes
1answer
2k views

Replacement for commit_on_success

I am porting an application from django 1.4.5 to django 1.6.1. I found that commit_on_success has been deprecated. Moreover I found specific incompatibilities when ...
6
votes
1answer
295 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
381 views

Executing a URL using RestTemplate

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
555 views

Constructing a URL for execution

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
274 views

Constructing a URL for execution using RestTemplate

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 ...
6
votes
2answers
762 views

Lock for preventing concurrent access in client data

I am trying to implement lock by which I don't want to have reads from happening whenever I am doing a write. Here is my ClientData class in which I am using ...
2
votes
1answer
175 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
355 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 ...
11
votes
1answer
2k 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 ...
14
votes
1answer
4k 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
2answers
2k 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 ...
8
votes
2answers
10k 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 ...
14
votes
2answers
1k views

O(1) lock free container

This is a lock-free Container class. By Container I mean it will hold objects for iteration at a later time. To achieve \$O(1)\$ ...
4
votes
3answers
207 views

Win7 atomic access class

I have a simple atomic access class designed to work with Windows threads: ...