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

learn more… | top users | synonyms

0
votes
0answers
31 views

A web server would be considered RPC or Rendevous? [closed]

I'm learning about concurrent programming and the book I'm reading (Concurrent Programming: Principles and Practice by Greg Andrews) mentions RPC (Remote Procedure Call) and Rendevous as the two main ...
24
votes
3answers
3k views

How much work should I place inside a lock statement?

I am a junior developer working on writing an update for software that receives data from a third-party solution, stores it in a database, and then conditions the data for use by another third-party ...
1
vote
1answer
103 views

is a DoS attack a good analogy of Dining Philosophers?

Let's say that, instead philosophers, we have TCP/IP connections to a server, and instead forks we have the server's TCP/IP avaliable ports. In this scenario, we don't have a lot of connections ...
-1
votes
1answer
34 views

What's the best way to implement a real time show board to show results from concurrent result producers in Java?

I'm making a load test tool that launches multiple thread to simulate load on the target server. Each thread executes a predefined set of commands in the structure of TestSuite - TestCase- TestStep ...
1
vote
1answer
78 views

Experiences with C++ Async/actor model Library [closed]

I am fairly experienced with async and concurrent programming in c# using event, actor, and task based patterns, but now I have a task in c++ with which I have basic familiarity and it needs some ...
2
votes
3answers
135 views

Accessing shared data without blocking in TPL

I am writing a class that contains data. It exposes methods that allow to query the data, while the data is also being updated from an external source (web service, for example). All the methods ...
5
votes
2answers
533 views

Where is the evidence for the performance of Node.js?

A lot of developers, especially ones who haven't used Node.js in production, seem to believe that Node.js is faster than other interpreted languages such as PHP, Python, and Ruby. These claims ...
1
vote
2answers
85 views

When, if ever, are basic concurrency optimizations generally made?

Lets say I need to preform the following computationally intensive task For i in range(100000000): doComplexCalculationWithNoSideEffects(i) Most people I talk to tell me that basically any ...
1
vote
1answer
24 views

How to model parallel processes (in a Bounded Context) with the same data store?

The situation. Let's say a background process puts stuff into data containers. It runs all the time, observes system events, and populates the data accordingly. The user may launch a control panel ...
1
vote
2answers
117 views

Scaling locks in high concurrency web apps [closed]

Our web application has a certain resource type that is shared accross multiple users, and may thus be read and written by anyone at anytime. We resorted to the usual suspects, database transactions ...
1
vote
3answers
187 views

Is there an algorithm to determine the amount of work needed to keep workers busy?

I wrote a multi-threaded program that randomly generates strings, and after generating, checks to see if the string contains a certain value. Namely, StringGenerator and StringChecker. What I'm trying ...
0
votes
1answer
51 views

Locking on data vs locking on functions

In concurrent code, what is the difference between, and the pros and cons of each: Locking on data Locking on functions My understanding is that locking on data is better, and I think I'm doing ...
1
vote
2answers
59 views

Lock data in DB while external API call is pending?

I have an interesting situation, and I am looking for the best way to solve it. My app runs like this: 1) The user gets a Promotion Pin from Some Company, and I have a db table with these pins also. ...
2
votes
1answer
80 views

Can concurrent code (threads, distributed computing, etc.) be directly ported to single-threaded/non-networked platforms?

Take an arbitrary "perfect" multi-threaded program, on an arbitrary multi-threaded platform, using an arbitrary programming language. Assuming that this "perfect" multi-threaded program: is ...
6
votes
0answers
131 views

Which languages have the best support for stackful coroutines? [closed]

Various languages support (some flavor of) coroutines. One way to discriminate coroutines is whether they are stackful or not (terminology based on Ana Lucia de Moura; Roberto Ierusalimschy (2004). ...
2
votes
2answers
133 views

Alternative locking strategies

I'm having a problem with the design of my application, that neither optimistic nor pessimistic locking tends to solve. Here is a simplified/altered version of the problem that describes the ...
23
votes
8answers
6k views

Function guaranteed to never return the same value twice [closed]

This is a question I was asked at a job interview, and I can't figure out the answer they were looking for, so I'm hoping someone here might have some ideas. The goal is to write a function that is ...
1
vote
0answers
65 views

Concurrent Processes - Monitors and Reader/Writers

So this is a general question about the use of monitors in the Reader/Writers problem. I know the monitor procedures for the Readers/Writers problem are used for mutual exclusion to a critical ...
3
votes
2answers
91 views

Simultaneous purchase in online shop bypassing limited offer

Our client sells several products in an online shop (our software) for a especially low price on the first purchase. Further purchases of each product will fallback to the regular price. E.g. product ...
5
votes
0answers
80 views

Does Optimistic Concurrency per object imply Serializability if a transaction will never span multiple objects?

Given a system which provides: Optimistic concurrency control / versioning per object (using CAS - Check-and-Set) Transactions that never need to span more then a single object. Snapshot Isolation ...
6
votes
6answers
1k views

What is the actual reason that locks (sentinels) in OO are hard to reason about? [closed]

In this talk, Rich Hickey introduces Clojure. He gives an Ants demo and talks about his motivations for implementing a Software Transactional Memory (STM) system. His reasoning for STM is that ...
0
votes
1answer
225 views

Algorithm to create custom ConcurrentHashMap?

I tried to look into concurrent HashMap source code to look in to how it is implemented. To me it looked very difficult to understand((In no way i am saying its not required :))). I thought if i need ...
2
votes
2answers
201 views

How do you solve issue of consistency in concurrent and distributed application (built around Bankers Dilemma)?

This is a classic problem which I'm sure has been solved many times by many different people. I don't have any formal training (I've not studied computer science or any other such academic subject) ...
0
votes
1answer
108 views

Coordinating a complicated data migration process

A project I'm involved in has suffered a change in scope, and before I set about trying to cook up some homegrown solution, I'm wondering if there is something out there -- some framework, for example ...
2
votes
2answers
122 views

Patterns for creating adaptive web crawler throttling

Im running a service that crawls many websites daily. The crawlers are run as jobs processed by a bunch of independent background worker processes, that picks up the jobs as they get enqueued. Now ...
1
vote
0answers
41 views

Semaphore : one for each shared resource?

Normally semaphores are implemented as integer variables. The value of a semaphore represents initially the number of processes that are allowed to access the shared resource at the same time, which ...
0
votes
1answer
107 views

Repurpose MySQL as a mutex

My application needs to perform an operation once every 10 minutes, but that operation is triggered many times more frequently. Occasionally it is triggered three or four times a second in different ...
4
votes
1answer
209 views

Error Handling Strategies in Multithreaded Environments

TL;DR What error generating and handling strategies do you use in Multithreaded code intended for use by others and why do you use them? If applicable, state what programming paradigm it's useful for. ...
21
votes
1answer
1k views

Is there a difference between fibers, coroutines and green threads and if that is so what is it?

Today I was reading several articles on the Internet about fibers, coroutines and green threads, and it seems like these concepts have very much in common, but there are slight differences, especially ...
1
vote
1answer
248 views

In C++, are acquire-release memory order semantics transitive?

According to cppreference, we can use release-acquire semantics to ensure write-read precedence between two threads as follows: // Thread A 1. Write to X 2. Atomic store to Y with ...
1
vote
1answer
166 views

Implementing distributed Semaphore for AWS workload

We have a messaging gateway in AWS (Amazon Cloud) that comprises of a number of nodes (Linux servers) responsible for receiving, routing, despatching and escalating messages (emails, SMS' and voice ...
0
votes
1answer
60 views

handling online payment for items with one quantity - design issue

I would like to implement a robust way to handle ecommerce payment for items with limited quantity, like for example exclusive paintings. Payment would ideally be accepted via PayPal and credit ...
0
votes
1answer
97 views

Locking database records

What I have right now: A table with lot of records. About 200 users can select a record according to some rules based on the data in each record. There is a high chance that 2 or more users will ...
20
votes
4answers
2k views

What prevents a race condition on a lock?

I understand the basics of what data races are, and how locks/mutexes/semaphores help prevent them. But what happens if you have a "race condition" on the lock itself? For example, two different ...
3
votes
1answer
147 views

How to avoid oscillation by async event based systems?

Imagine a system where there are data sources which need to be kept in sync. A simple example is model - view data binding by MVC. Now I intend to describe these kind of systems with data sources and ...
3
votes
0answers
178 views

How can I make a universal construction more efficient?

A "universal construction" is a wrapper class for a sequential object that enables it to be linearized (a strong consistency condition for concurrent objects). For instance, here's an adapted ...
2
votes
1answer
266 views

Where to implement thread-safety logic for my queue data structure?

I will immediately confess that I do very little multithreading, so questions of style and organization in this domain a little fresh to me. I've written a data structure (in Python, if that matters) ...
3
votes
1answer
168 views

Can the possibility of a data race be ignored in some cases? (while having concurrent threads) [duplicate]

I am programming a game engine as a hobby project, and I would like to separate physics and drawing into two separate threads. The position vectors of entities are subject to modifications by the ...
1
vote
1answer
108 views

Cache concurrency: ensuring latest version in cache

We have a data service app working on object graphs. We place some complex graphs in a (memory) caching tier as a single data item, so as to avoid the length of time to retrieve every individual data ...
1
vote
2answers
269 views

Are all race conditions worth fixing? [closed]

I just wrote the following piece of code (in delphi): procedure Update(Value: Integer); begin // If the last update was yesterday, replace yesterday value if CompareDate(FLastUpdate,Now) <> ...
17
votes
4answers
4k views

Programs that claim they are not “multi-core” friendly

You see this phrase or similar kicked around from time to time, generally referring to a program that claims they were not designed to take full advantage of multi-core processors. This is common ...
0
votes
3answers
2k views

Super Fast File Storage Engine

I basically have one big gigantic table (about 1.000.000.000.000 records) in a database with these fields: id, block_id, record id is unique, block_id is not unique, it contains about 10k (max) ...
12
votes
1answer
288 views

What intermediate representations can be used to reason about concurrency?

I am trying to better understand what would be required for a compiler to be able to make intelligent choices regarding concurrency on behalf of the programmer. I realize that there are many difficult ...
15
votes
1answer
4k views

Are go-langs goroutine pools just green threads?

The commentator here offers the following criticism of green threads: I was initially sold on the N:M model as a means of having event driven programming without the callback hell. You can write ...
0
votes
3answers
191 views

If mutual exclusion is not implemented, how would we detect a race condition?

Suppose we are in a distributed environment, and mutual exclusion is not implemented yet. So how would we be able to detect race conditions? When I researched, use of non-blocking algorithms was ...
3
votes
1answer
270 views

Does Clojure borrow concurrency ideas from Haskell?

In code quarterly interview with Rich Hickey, Michael Fogus hints that Clojure borrows a lot from Haskell: Fogus: As someone who only knows Haskell enough to read the papers, Clojure appears to ...
1
vote
1answer
270 views

Editing files without race conditions?

I have a CSV file that needs to be edited by multiple processes at the same time. My question is, how can I do this without introducing race conditions? It's easy to write to the end of the file ...
13
votes
2answers
3k views

SQLite with two python processes accessing it: one reading, one writing

I'm developing a small system with two components: one polls data from an internet resource and translates it into sql data to persist it locally; the second one reads that sql data from the local ...
12
votes
2answers
1k views

Is The Free Lunch Over? [closed]

In his famous The Free Lunch Is Over article from 2005, Herb Sutter predicted a Concurrent Programming Revolution as big as Object-Oriented Revolution. Has this revolution really happend in years 2005 ...
3
votes
1answer
409 views

What do goroutines, Ruby Fibers, etc. look like to the OS/Kernel?

In process concurrency and thread concurrency it's quite obvious how the kernel sees these as they map directly to real things that the kernel manages. When it comes to Golang goroutines and Ruby ...