Skip to main content

Questions tagged [concurrency]

Concurrency is a property of systems in which several processes are executing at the same time.

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. ...
Joel Harkes's user avatar
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 ...
Xyds's user avatar
  • 11
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) { ...
stands2reason's user avatar
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 ...
Cristi's user avatar
  • 187
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 ...
staccato's user avatar
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: ...
tuck_y's user avatar
  • 181
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 ...
Unlikus's user avatar
  • 131
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 ...
dragons's user avatar
  • 121
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 ...
eliangius's user avatar
  • 111
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 ...
Avantgarde's user avatar
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 ...
danielrs's user avatar
  • 111
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 ...
Corentin Aulagnet's user avatar
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 ...
Álvaro García's user avatar
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 ...
Carlos Rodrigues's user avatar
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 ...
candied_orange's user avatar

15 30 50 per page
1
2 3 4 5
26