Skip to main content

Questions tagged [concurrency]

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

Filter by
Sorted by
Tagged with
0 votes
3 answers
327 views

We have a desktop application written in Java that communicates with a DB. We support Oracle and Postgres. For the purpose of this question, let's focus on Postgres Our app uses one connection for all ...
Sergey Zolotarev's user avatar
-2 votes
3 answers
276 views

We have third party software being tested. Our software has to interface with this, hence my involvement. There are some things I consider serious technical flaws. I'd like to communicate these things ...
Dan's user avatar
  • 301
4 votes
3 answers
2k views

I inherited a piece of software. This program is connected to an external hardware, which is a measurement device. Every 100 milliseconds, a value is read from this device and displayed to the user. ...
SomeBody's user avatar
  • 151
2 votes
4 answers
317 views

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

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

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

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

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

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
  • 191
2 votes
3 answers
638 views

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 ...
benjamin-lieser's user avatar
1 vote
1 answer
217 views

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

(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
1k views

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

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 example ...
danielrs's user avatar
  • 111
2 votes
2 answers
159 views

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
4 votes
5 answers
2k views

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

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
3k views

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
0 votes
2 answers
257 views

I have a Kafka topic providing events of the following type: id(hash):[ADD|REMOVE]. These events may be generated at a high rate and are idempotent, i.e. getting 123:ADD one time and ten times in a ...
svz's user avatar
  • 307
7 votes
1 answer
540 views

I am reading through "Clean Architecture: A Craftsman's Guide to Software Structure and Design" and it says that: All race conditions, deadlock conditions, and concurrent update problems are ...
Quantum Guy 123's user avatar
1 vote
1 answer
664 views

It's common to implement optimistic concurrency control in DynamoDB by giving each item in the database a top-level "version" attribute and only allowing an update of an item to succeed if ...
fblundun's user avatar
  • 111
1 vote
1 answer
873 views

In DDD, the model has to implement only the bussiness logic, and it has not the responsability about another things, like persistance. So I was thinking that perhaps is in the application layer a good ...
Álvaro García's user avatar
0 votes
0 answers
188 views

We are using a client library over Memcache. This library has a lot of logic for Memcache client and is indispensable in current form. One of the API of the library is put which internally just uses ...
Saurav Prakash's user avatar
0 votes
1 answer
475 views

I know that we have the functionality to lock records or setting isolation level, but this is not my question. By default if dozen/hundred of users edit the same record at the exact same time what ...
stubborn's user avatar
  • 213
0 votes
0 answers
1k views

I want to understand how does Spring Boot and Postgresql DB handle the concurrent requests for updating a value in DB. Consider this example of facebook likes, if there are multiple instances of ...
Spring boot progammer's user avatar
0 votes
1 answer
332 views

When designing my simulator, I have gotten stuck on 2 main design choices. The simulator can be described as having X number of nodes (between 50 - 2000) that each need to independently do some ...
Nabiel Kandiel's user avatar
1 vote
4 answers
5k views

Docs and blog posts describe what row version columns do, but rarely delve into the decision process of when it's appropriate to use them. I suspect that many developers just add them to every table ...
Kevin Krumwiede's user avatar
3 votes
1 answer
353 views

Intro Structured concurrency is a relatively recent concept for structuring concurrent programs. It has implementations in for example Python, Java and Swift. Examples of structured concurrency often ...
Lii's user avatar
  • 472
2 votes
1 answer
568 views

Java used to have green threads, i.e., implemented inside the VM. The description of Python Eventlets says "Eventlet is built around the concept of green threads (i.e. coroutines...).... Green ...
Joshua Fox's user avatar
  • 1,110
6 votes
1 answer
1k views

Current situation Right now I have a method like Data lookupData(Key id) { std::lock_guard<std::mutex> lock(m_mutex); auto it = m_dict.find(id); if(it == m_dict.end()) { ...
Daniel McLaury's user avatar
0 votes
3 answers
218 views

In C#, how do I handle critical section with two different "rights of way"? Theoretical use case: imagine a swimming pool (the resource). Many individual swimmers (worker threads A, B, C, ...
Yann's user avatar
  • 119
0 votes
2 answers
119 views

tl;dr An audacious claim by a classmate caused me to question the definition of the word "support" (verb) in the context of computer science. Is it analogous to standard definitions where a ...
J_UPS's user avatar
  • 13
0 votes
0 answers
38 views

I'm writing an express/socket.io-powered game server for a web game. I have a central map of game state objects, each representing an ongoing match, like so: // map of gameId -> game (primary ...
temporary_user_name's user avatar
1 vote
0 answers
332 views

I need to consume several APIs concurrently. In order to do that I decided to containerize each API client code and manage them using Kubernetes. Some of those APIs need to be "walked". They ...
beardeadclown's user avatar
21 votes
3 answers
5k views

Suppose I'm building a web application using Django. Some of the views need to touch multiple database tables or rows, and there is some kind of state consistency that I need to ensure among the ...
Kal's user avatar
  • 365
4 votes
4 answers
4k views

I'm an experienced Software Engineer but very weak in concurrency because of no prior experience in that. I've been interviewing with several companies in which I was asked similar kind of questions ...
SherlockHolmesKePapa's user avatar
-1 votes
1 answer
2k views

I'm working on a web application using Spring (Java and JPA + Hibernate) and I was wondering if there is a way of locking a MYSQL table and then when another web service (or even another thread from ...
Jordi Pagès's user avatar
4 votes
1 answer
423 views

This post implies that the creators of Rust had to add the "async" keyword to make the async/await functionality backward compatible. Why do we need the async keyword? In a new language, ...
phil-daniels's user avatar
-4 votes
1 answer
450 views

A while ago Herb Sutter wrote The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software which I basically interpret to mean that, in order to improve performance, software engineers ...
Startec's user avatar
  • 157
1 vote
3 answers
1k views

I have a task that I need to make sure it only runs once in my dockerized environment (managed by k8s), running the post-upgrade script is one example. Because each dockerized app can run the task and ...
Qiulang 邱朗's user avatar
4 votes
5 answers
3k views

Here is what I am specifically doing: I have a thread-safe queue One 'write' thread constantly writes to the queue with data that comes from another service Multiple 'read' threads take from the ...
ulak blade's user avatar
1 vote
2 answers
3k views

I'm trying to design a system to buy mangoes (not really mangoes, but it's a good proxy). One mango is the same as the other. These are very high-in-demand mangoes; quite possible many people at once ...
MyFooBar's user avatar
3 votes
1 answer
199 views

For fun, I'm developing a multi-player card game. I plan to run it on a single cheap VPS, so deployment would have to kill the process and re-start it with the new code. There is no Load Balancer. I'm ...
r. smith's user avatar
-1 votes
1 answer
156 views

I am building an API for webshop. I need to implement following scenario: There are x (let's say 500) digital items, which will have same price (let's say each item costs 10$), but unique serial ...
Ramūnas's user avatar
0 votes
1 answer
215 views

I got the following interview question: Say the company has this event, where we will create a button on a website and only the first ten clicks will be accepted and win a prize. Assume that there a ...
amazingsaluyot's user avatar
0 votes
2 answers
914 views

Correct me if I am wrong, but regarding file I/O and concurrency, I understand that it makes no sense to read 2 files concurrently, since the data bus cannot be used simultaneously. This means that ...
Nadir's user avatar
  • 103
0 votes
2 answers
1k views

I have a reinforcement learning project. For this I created a vectorized environment in C++, which is a handler for multiple instances of a simple game. It is highly parallelizable. Each worker can ...
Dudly01's user avatar
  • 137
-3 votes
1 answer
432 views

In Programming Distributed Computing Systems: 7.3.4 Distribution Distributed computing is inherently concurrent. However, distribution aspects go far beyond concurrency. Of particular importance from ...
Tim's user avatar
  • 5,565
26 votes
4 answers
6k views

Presuming that I have written some sequential code where it can be broken down into multiple isolated tasks, it seems it might be efficient for concurrency to be introduced. For example print(...
Ben's user avatar
  • 369
-1 votes
3 answers
652 views

I am trying to solve this synchronization problem in C to practice for my lectures of Operating Systems where we use POSIX and Linux. I've been trying for days to find an approach to this problem with ...
78dtat78da's user avatar

1
2 3 4 5
8