Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

6
votes
2answers
1k 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 ...
7
votes
3answers
352 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 ...
17
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)\$ ...
15
votes
1answer
5k 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 ...
12
votes
1answer
3k 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
559 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 use-...
6
votes
3answers
3k 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 ...
5
votes
1answer
467 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
460 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 ...
4
votes
1answer
73 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 ...
2
votes
1answer
254 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 ...
1
vote
0answers
56 views

Block a partcular machine for a particular period of time interval after x failure

This is an extension to this question I am working on a library which makes Http call to my service. I have below two requirements: If my service machine doesn't respond back (there is a socket ...