Questions tagged [concurrency]

Questiont about issues of concurrency such as synchronization and deadlocks.

Use this tag for concurrent and , concurrency primitives, models of concurrency, etc.

See also , and . See these discussions for more information on differences between the terms:


Concurrency is the study of systems in which multiple threads of computation or processes execute in the same environment and at the same time. The concurrent threads may execute simultaneously on different processors or in turns. Concurrency studies how these computations are executed and how they may interact.

Of particular interest are situations when multiple threads compete for the same resources, potentially causing for instance data races or dead locks. Concurrency theory investigates how such situations can be avoided and how programs can be proven to never run into one.

295 questions
54
votes
3 answers

Contrasting Peterson’s and Dekker’s algorithms

I am trying to understand the algorithms by Peterson and Dekker which are very similar and display a lot of symmetries. I tried to formulate the algorithms in informal language like follows: Peterson's: "I want to enter." …
gbag
  • 719
  • 1
  • 6
  • 9
45
votes
5 answers

Difference between Parallel and Concurrent programming?

When looking at concurrent programming, two terms are commonly used i.e. concurrent and parallel. And some programming languages specifically claim support for parallel programming, such as Java. Does this means parallel and concurrent programming…
nish1013
  • 561
  • 1
  • 5
  • 5
34
votes
2 answers

What is the difference between user-level threads and kernel-level threads?

After reading several sources I'm still confused about user- and kernel-level threads. In particular: Threads can exist at both the user level and the kernel level What is the difference between the user level and kernel level?
Sheldon
  • 803
  • 2
  • 9
  • 16
32
votes
2 answers

What does 'true concurrency' mean?

I often hear phrases like 'true concurrency semantics' and 'true concurrency equivalences' without any references. What does those terms mean and why are they important? What are some examples of true concurrency equivalences and what is the need…
Daniil
  • 2,207
  • 19
  • 24
23
votes
3 answers

Similarities and differences in major process algebras

To my knowledge, there are three major process algebras that have inspired a vast range of research into formal models of concurrency. These are: CCS and $\pi$-calculus both by Robin Milner CSP by Tony Hoare and ACP by Jan Bergstra and Jan Willem…
Dave Clarke
  • 20,345
  • 4
  • 70
  • 114
21
votes
1 answer

Lock-free, constant update-time concurrent tree data-structures?

I've been reading a bit of the literature lately, and have found some rather interesting data-structures. I have researched various different methods of getting update times down to $\mathcal{O}(1)$ worst-case update time [1-7]. Recently I begun…
20
votes
6 answers

Why must uncommitted transactions be undone in backwards order?

I have a database log where some transactions win (they are committed before crash) and some lose (not committed yet). We learned in class that the losers' actions have to be undone backwards. Is there any reason for doing this backwards? Can anyone…
prjctdth
  • 201
  • 2
  • 3
19
votes
4 answers

Why is the consensus number for test-and-set, 2?

According to Wikipedia, The test-and-set operation can solve the wait-free consensus problem for no more than two concurrent processes. Why can't it solve the problem for more than two processes?
ben
  • 295
  • 2
  • 9
19
votes
1 answer

Are there hardware lock implementations without test-and-set or swap?

Locks are usually implemented thru test-and-set and swap machine-level instructions. Are there other implementations that do not use these? Also, can we say that all hardware level solutions to the critical section problem can be categorized into…
18
votes
2 answers

Is it possible for a stack-based programming language to be concurrent?

I have been reading about stack-based programming languages, such as FORTH and Cat, and it seems that given their nature, they can only execute one action at a time regardless of their paradigm (FORTH is imperative whereas Cat is functional). An…
Joan Vene
  • 195
  • 1
  • 8
17
votes
1 answer

Differences between the Actor Model and Communicating Sequential Processes (CSP)

When we look at the Actor Model and Communicating Sequential Processes we see that they are both trying to do concurrency based on message passing, yet they are distinct. (We see implementations of the CSP Model in go-lang's goroutines (and…
hawkeye
  • 1,199
  • 8
  • 20
14
votes
2 answers

Are CPU architectures biased towards procedural runtimes?

Are there any changes that could be made to CPUs to make them perform better for concurrent runtimes like Rust? For instance, are there changes to branch prediction implementations or cache sizes that would help concurrent runtimes? I have the…
14
votes
3 answers

Who needs linearizability?

I've been reading about the differences between serializability and linearizability, which are both consistency criteria for replicated systems such as replicated databases. However, I don't know in which cases linearizability would be needed, even…
Eduardo Bezerra
  • 245
  • 2
  • 8
14
votes
1 answer

What is the purpose of M:N (Hybrid) threading?

In other words, what advantages does Hybrid threading have over 1:1 (kernel only) and N:1 (user only) threading? This is a follow-up to What is the difference between user-level threads and kernel-level threads?
Sheldon
  • 803
  • 2
  • 9
  • 16
12
votes
2 answers

Good snapshottable data structure for an in-memory index

I'm designing an in-memory object database for a very specific use case. It is single writer, but must support efficient concurrent reads. Reads must be isolated. There is no query language, the database only supports: get object/-s by…
dm3
  • 223
  • 1
  • 6
1
2 3
19 20