Questions tagged [concurrency]
Concurrency is a property of systems in which several processes are executing at the same time.
376
questions
2
votes
4
answers
125
views
Ensure concurrent processing based on a message key
I've been wondering about the following: Say you have an async message/task and you want that message only processed one at the time. for example: Only process one order for each customer at the time. ...
0
votes
1
answer
127
views
Using a thread-locking service as a singleton dependency in .NET
So I'm working on the Web API for my website and certain API calls need to be performed with thread safety in the application's runtime. I have created a locking service which uses a semaphore for ...
0
votes
1
answer
178
views
C++ memory visibility, passing data between threads
I use code like this and it seems to work fine:
void addActions(const vector<zero_arity_function>& _actions)
{
actionsMutex.lock();
for (auto entry : _actions) {
...
1
vote
2
answers
150
views
Ensuring partial order of concurrent operations
I have the following operations:
User submits event
We store event in a queue
Wait for events and store them in db for redundancy
Wait for events and process them
Remove events from queue and db
For ...
2
votes
2
answers
164
views
How to document a concurrent communication protocol for less theoretical people
We are developing a multi-user web-based application, where the users can join a "room" and a complicated handshake has to be set up between them, to be able to use a library on each ...
1
vote
3
answers
450
views
What algorithm can I use in order to not let there be two rows with same "mobile number" in database?
The issue that I'm facing is on a banking app. There are two ways to register for internet banking.
A) Self Register
B) Ask for bank to register via their GUI panel backend.
Consider this scenario:
...
2
votes
3
answers
446
views
Are there downsides of two TCP connections for bidirectional communication?
I have a server which maintains some shares state.
The clients can send some requests and get an answer from the server.
Sometimes the server needs to give some information to the client ...
1
vote
1
answer
166
views
High Throughput Concurrent Map Access and Periodic Updates Causing Contention and Latency Spikes
I am working on a Go application where two concurrent maps, products and productCatalog, are accessed by numerous threads in live traffic to retrieve data at high throughput. These maps are populated ...
1
vote
2
answers
359
views
Handling simultaneous duplicate expensive read-only HTTP requests
(updated)
We have a read-only REST endpoint that performs a somewhat “expensive“ but transient request. Without client needing to poll, we need a mechanism for the server to avoid unnecessary ...
4
votes
2
answers
830
views
How can a web browser simultaneously run more videos than the number of CPU cores?
I've been learning about threads and processes and I understand that threads allow you to write concurrent code: where executing threads switch very quickly from one to another, giving the impression ...
1
vote
2
answers
78
views
Phantom read race condition keeping RDBMS in sync with external storage
Here's an interesting scenario, consider a cache with many buckets, and resources that can be shared between buckets:
Bucket
Highest to lowest priority
Foo
A, B, C, D
Bar
B, C, D
Baz
A
In the ...
2
votes
2
answers
102
views
Should a mobile app keep an 'outdated' version of the data and refresh it from database or always fetch from database?
I'm building a mobile, in which the user is able to create,modify and delete entries in a database. There are multiple screen where some of the entries are displayed: (here are some examples, not ...
3
votes
5
answers
1k
views
Where to control optimistic concurrency in a domain-driven design (DDD) application?
I am thinking how to develop an application in a DDD way, and now I am thinking about the concurrency part.
In some examples I have seen that in the domain classes are injected with dependency ...
0
votes
0
answers
37
views
Handling competing requests for the same "id" in different Kubernetes PODs
I have the following problem, I am implementing a delivery management service and a single order can be competed between N deliveryboys, this service is being executed on Kubernetes with 5 PODs of ...
6
votes
3
answers
2k
views
Checking if a file exists before writing. Always avoid, or sensible with the right use case?
There are few reliable absolutes in this world. One I have relied on is the idea that checking if a file exists before doing something with it just creates an unwanted race condition. Meaning between ...