Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [concurrency]

Questiont about issues of concurrency such as synchronization and deadlocks.

0
votes
2answers
44 views

Whats exact definition of 'atomicity' in programming?

the definition of 'atomicity' says that a transaction should be able to be terminated without being touched or manipulated by possibly concurrent running actions during its process. But does that also ...
4
votes
1answer
44 views

Are two CCS processes equivalent with respect to weak bisimilarity if and only if they satisfy exactly the same set of HML formulas?

I was skimming this recent paper and I was struck by the following statement: two processes are equivalent with respect to weak bisimilarity if and only if they satisfy exactly the same set of HML ...
1
vote
0answers
42 views
1
vote
1answer
41 views

Can a schedule be conflict serializable but not serializable?

A schedule is called conflict serializable if it can be transformed into a serial schedule by swapping non-conflicting operations. Then, My question is: Can a schedule be conflict serializable but ...
0
votes
0answers
32 views

When cascadeless and / or recoverable schedules can contain blind writes?

Some quick definitions / theory: If instructions $I_i$ and $I_j$ of two different transactions operate on same data item and if any of them is a write operation then they are conflicting ...
2
votes
0answers
73 views

What is a counterexample for Lamport's distributed mutual exclusion algorithm with non-FIFO message queues?

Lamport's distributed mutual exclusion algorithm (also described here) solves mutual exclusion problem for $N$ processes with $3(N-1)$ messages per request ("take and release lock" cycle). It ...
1
vote
0answers
36 views

Prove that set of operations form a commutative Monoid

this is my first post on this exchange. I am looking for some help with defining a proof that a set of operations I have designed forms a commutative monoid. (Disclaimer: I am not sure that I have ...
1
vote
2answers
28 views

System restarted before transaction is committed

Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then apply a 5% interest. ...
1
vote
1answer
54 views

Can 2-philosophers problem be analogous to dining philosophers problem?

Two philosophers A and B, two forks numbered "1", "2"; A needs both "1" and "2" for eating, so does B. Is this theoretical a dining philosopher problem? I'm questioning about the forks philosopher A ...
1
vote
0answers
30 views

How can I implement locking a range of values in a sorted sequence?

I am trying to write a general purpose locking algorithm which allows me to lock a range of contiguous values in a sorted array. To start with, these could be exclusive locks - so two concurrent locks ...
0
votes
0answers
364 views

Thoughts on definition for disadvantage of concurrent processing?

I'm a Computer Science student currently learning about concurrent processing. I found the benefits and disadvantages in my book vague, did some online research and put together a more detailed way of ...
0
votes
0answers
10 views

Is a schedule with autocommit and no aborts automatically recoverable?

As in the title, since we won't have problems with cascading aborts and each transaction is committed automatically, doesn't this mean that the schedule will always be recoverable?
1
vote
1answer
46 views

What is the formal statement of the dining philosopher's problem?

I've read about it in a few places and I'm not sure I get it. Are the philosopher's allowed to act simultaneously? Do they each take 1 action simultaneously, then go on to their next action?
1
vote
0answers
50 views

Do we really need a mutex in this case?

Wikipedia's solution for multi Producer-Consumer problem uses both mutexes and semaphores. ...
1
vote
1answer
211 views

Which Peterson’s Solution is right?

I have seen two different Peterson’s Solution to mutual exclusion, one is from Modern Operating Systems: ...
2
votes
0answers
50 views

how to find the depth of a concurrency bug

How to find the depth of a concurrency bug The below program runs on two separate threads and shares the variable x. Variables t1 and t2 are local to their threads. The program has a concurrency bug ...
0
votes
1answer
22 views

Can Multiprocessor Systems Implement Both Temporal Multithreading and Simultaneous Multithreading?

I am aware that multiprocessor systems often implement simultaneous multithreading in order to allow multiple threads to run on different CPUs. I am also aware that uni-core systems often implement ...
0
votes
1answer
46 views

What is the Difference Between Many-to-Many (M:M) Threading and Hybrid (M:N) Threading?

I have been researching threading and come across several websites which all say contradicting statements about which and how many thread models exist. Some websites say there are only three: 1:1, M:1 ...
1
vote
1answer
81 views

What fraction of all combinations is guaranteed to be deadlock free?

I found this question in the exercise of Tanenbaum (operating systems): Two processes, $A$ and $B$,each need three records $1, 2, \text{ and } 3$ in a database. If $A$ asks for them in the order $...
1
vote
0answers
57 views

How to Optimise Each Multithreading Technique? (Cooperative/Preemptive/Simultaneous)

I am currently in the process of writing an IB Extended Essay on the efficacy of multithreading on increasing the performance of applications. So far, I have been able to deduce that there are three ...
0
votes
0answers
35 views

Writing LTL formula for sequencing with coordination

Suppose there are 2 workers w1 and w2 who can cool a hot iron. So if iron is hot (denoted by atomic proposition ...
3
votes
0answers
93 views

Is the Bakery Lock fair?

Consider this implementation of the Bakery Lock: ...
0
votes
1answer
51 views

Checking claim in paper “A Read-Only Transaction Anomaly Under Snapshot Isolation” by Alan Fekete et al

In the 2004 paper "A Read-Only Transaction Anomaly Under Snapshot Isolation" by Alan Fekete et al. (which can be found here and here) the authors state: We also note that any execution of T1 and T2 ...
0
votes
1answer
38 views

How to keep track of changes done to concurrent stacks?

I am writing a small RPN calculator that works on some stacks concurrently. For example, if I have two functions: ...
1
vote
1answer
17 views

Are process-safe mutexes shared between OSes?

I understand you can use process wide mutexes, but does this still apply if you have an additional virtualized operating system provisioned? For example, take two OSes: ...
1
vote
2answers
372 views

Serializability and the Lost Update Problem

Serializability is the strongest consistency level with regard to the execution of two concurrent transactions T1 and T2. That is, if T1 and T2 independently change the application between consistent ...
-2
votes
1answer
46 views

Erlang- Creating a function which only adds/subtracts positive integers

I want to create a function which allows me to input a list, and then add all of the positive numbers from the list together, leaving any that are negative. ([3,1,-1]) For example only 3 and 1 would ...
2
votes
1answer
58 views

What are good resources for self teaching parallel/concurrent/multithreaded programming techniques? [closed]

I’m having a hard time finding anything thorough. I have found some courses with titles like "parallel and concurrent programming in Java", but I'm looking to learn general techniques, not their use ...
4
votes
1answer
77 views

Task scheduling algorithm that limits concurrency

My prof introduced us an algorithm with semaphores that was used to solve the "dining philosophers" problem. The algo is ok, apart from that it limits concurrency. What does mean that it "limits ...
0
votes
1answer
75 views

Concurrency and fairness

I'm studying the concurrency in programming and the atomic instructions. What i have not understood is the concept of "fairness" applied to this matter. Can you give me an hint ?
0
votes
0answers
24 views

Concurrency and non deterministm

I was introduced in concurrency programming this morning. I haven't understood why "non deterministm" is a fundamental aspect of cuncurrenty programming. What i think is that, since there is a ...
14
votes
2answers
2k views

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

interval tree clocks

I understand how vector clocks detect concurrent events, but they are designed for a fixed number of nodes, so we can't easily add and remove nodes. And with interval tree clock we can. Could you ...
1
vote
0answers
112 views

bakery algorithm, switching up the condition

I'm currently studying the Bakery Algorithm. I understand it for what it is but now I want to switch it up a bit. If we changed the < in the 2nd ...
2
votes
1answer
54 views

Compute the mode of an array concurrently

As an academic exercise, I have to write a parallel algorithm that given a sorted array of $n$ integers computes the mode (i.e. the item with the highest frequency) efficiently using $p$ processors, ...
2
votes
1answer
86 views

How to do compare-and-increment different locations with in memory MVCC?

I'm reading the paper An Empirical Evaluation of In-Memory Multi-Version Concurrency Control which is about implementations of MVCC for in-memory databases. Section 3.3 on Two-phase Locking (MV2PL) ...
1
vote
1answer
611 views

What does synchronous and asynchronous mean in computer science?

Words synchronous and asynchronous can be met several times, in different contexts, when studying computer science. As an example : Synchronous and asynchronous circuits. Synchronous and asynchronous ...
0
votes
0answers
17 views

concurrency control in real time database

Can Lamport's Bakery algorithm be used for controlling concurrency in soft real time database system (case study of stock trading)?
0
votes
1answer
69 views

Conflict serializibility

So, the task is to prove the following: If S is a schedule containing at most one write action, then S is conflict-serializable. The answer is yes, but I disagree, because the following schedule ...
3
votes
1answer
688 views

Number of conflict serializable schedules

Two transactions $T_1$ and $T_2$ are given as: $$T_1: r_1(X)w_1(X)r_1(Y)w_1(Y)$$ $$T_2: r_2(Y)w_2(Y)r_2(Z)w_2(Z)$$ where $r_i(V)$ denotes a read operation by transaction $T_i$ on a ...
2
votes
1answer
69 views

FLP Impossiblity Result assumption of $C_1 = e'(C_0)$

FLP86's famous proof regarding impossibility of async distributed processes with a single fault assumes in the proof of the third lemma the existence of an event $e'$ such that the neighbor ...
1
vote
0answers
32 views

Lamport's distributed mutual exclusion: wait-chain order clock

Regarding Lamport's mutual exclusion... Where messages are exchanged in the following sequence between nodes S, G1, and G2. G1 and G2 are the members of the group. (for this, lets just assume that ...
1
vote
0answers
91 views

Is Dekker's algorithm not k-bounded for any finite k?

Consider this version of the algorithm, for only 2 processes, 0 and 1: ...
2
votes
1answer
46 views

Are synchronous message sends a subset of async. ones?

Imagine any object oriented PL based around the idea of message sends: some method basically performs something like this: ...
3
votes
3answers
82 views

Finite state automaton's reaction to simultaneous events

What does happen if two events simultaneously occur at a particular state of a finite state automaton (FSA)? For example, assume that an FSA's event table at its state $s$ is as follows: $\delta(s,...
0
votes
1answer
73 views

Question about IO automaton

I'm currently reading Nancy Lynch book about distributed systems, chapter about IO automaton. And I have following questions related to book exercise 8.13(c). We are given some automaton A with sig(A)...
2
votes
1answer
478 views

semaphore implementation with test and set

I'm trying to understand the algorithm for implementing semaphores on SMP system using test and set instruction described here: https://people.mpi-sws.org/~druschel/courses/os/lectures/proc4.pdf (and ...
1
vote
2answers
284 views

2:1 Mutual exclusion with semaphores

I'm stuck on this semaphore exercise (it's a exam question of a previous exam and I'm studying for that exam): There are three processes: A, B and C. Process A wants to execute method a(); Process B ...
0
votes
3answers
352 views

How can a spinlock progress when it's busy-waiting?

I read that in spinlock, process keeps on waiting for the lock continuously in a loop until it receives signal(lock) or ...
3
votes
1answer
112 views

Are Test and set primitives as powerful as semaphores?

I get confused because i don't know if it is possible to use Test and Set primitives in case where more then one process can be enter in critical section at the same time.