Fast mutual exclusion algorithms using read-modify-write and atomic read/write registers (original) (raw)

Fast and fair mutual exclusion for shared memory systems

Proceedings. 19th IEEE International Conference on Distributed Computing Systems (Cat. No.99CB37003)

Two fast mutual exclusion algorithms using read-modifywrite and atomic read/write registers are presented. The first one uses both compare&swap and fetch&store; the second uses only fetch&store. Fetch&store are more commonly available than compare&swap. It is impossible to obtain better algorithms if "time" is measured by counting remote memory references. We were able to maintain the same level of performance with or without the support of compare&swap. However, fairness is degraded from 1-bounded bypass to lockout freedom without the support.

Bounded-Bypass Mutual Exclusion with Minimum Number of Registers

IEEE Transactions on Parallel and Distributed Systems, 2009

A mutual exclusion mechanism that is both fair and space efficient can be highly valuable for shared memory systems under time and memory constraints such as embedded real-time systems. Several algorithms that utilize only one shared variable and guarantee a certain level of fairness have been proposed. However, these use hypothetical read-modify-write operations that have never been implemented in any system. This paper presents two fair algorithms that do not use such operations, each of which uses a single additional shared variable. The proposed algorithms employ commonly available operations, fetch&store and read/write, on two shared variables. The first algorithm satisfies the bounded-bypass condition. The second is an improvement on the first that satisfies the FIFO condition, which is the most stringent fairness condition. Additionally, it is shown that achieving the bounded-bypass condition using the same set of operations requires two shared variables. Both of the algorithms are thus optimal with respect to the number of shared variables.

A tight bound on remote reference time complexity of mutual exclusion in the read-modify-write model

Journal of Parallel and Distributed Computing, 2006

In distributed shared memory multiprocessors, remote memory references generate processor-to-memory traffic, which may result in a bottleneck. It is therefore important to design algorithms that minimize the number of remote memory references. We establish a lower bound of three on remote reference time complexity for mutual exclusion algorithms in a model where processes communicate by means of a general read-modify-write primitive that accesses at most one shared variable in one instruction. Since the general read-modify-write primitive is a generalization of a variety of atomic primitives that have been implemented in multiprocessor systems, our lower bound holds for all mutual exclusion algorithms that use such primitives. Furthermore, this lower bound is shown to be tight by presenting an algorithm with the matching upper bound.

Fast mutual exclusion for uniprocessors

ACM SIGPLAN Notices, 1992

In this paper we describe restartable atomic sequences, an optimistic mechanism for implementing simple atomic operations (such as Test-And-Set ) on a uniprocessor. A thread that is suspended within a restartable atomic sequence is resumed by the operating system at the beginning of the sequence, rather than at the point of suspension. This guarantees that the thread eventually executes the sequence atomically . A restartable atomic sequence has significantly less overhead than other software-based synchronization mechanisms, such as kernel emulation or software reservation. Consequently, it is an attractive alternative for use on uniprocessors that do no support atomic operations. Even on processors that do support atomic operations in hardware, restartable atomic sequences can have lower overhead. We describe different implementations of restartable atomic sequences for the Mach 3.0 and Taos operating systems. These systems' thread management packages rely on atomic operations...

Accurate and Fast Mutual Exclusion Algorithm

2012

Multiprocessing systems are programmed cleanly using Critical sections. When a process desires to access some shared data it first gets mutual exclusive access to critical sections for reliable outcome as processes may possibly manipulate the data. This paper presents an algorithm that can solve the problem in single processing, multiprocessing and distributed systems efficiently with minimal changes. For distributed systems we introduce message passing service while keeping rest of the mechanism same works faster than many other algorithms for distributed systems. The algorithm compares its efficiency with bakery's algorithm and performs much better with the liberty of introduction of multiple critical sections for dissimilar shared data. Due to this multiple processes can execute in different critical sections concurrently.

A Practical Single-Register Wait-Free Mutual Exclusion Algorithm on Asynchronous Networks

Lecture Notes in Computer Science, 2006

This paper is motivated by a need of practical asynchronous network systems, i.e., a wait-free distributed mutual exclusion algorithm (WDME). The WDME algorithm is very appealing when a process runs on asynchronous network systems and its timing constraint is so restricted that the process cannot perform a local-spin in a wait-queue, which forces it to abort whenever it cannot access the critical region immediately. The WDME algorithm proposed in this paper is devised to eliminate the need for processes to send messages to determine whether the critical region has been entered by another process, an unfavorable drawback of a naive transformation of the shared-memory mutual exclusion algorithm to an asynchronous network model. This drawback leads to an unbounded message explosion, and it is very critical in real network systems. Design of the WDME algorithm is simple, and the algorithm is practical enough to be used in current distributed systems. The algorithm has O(1) message complexity which is suboptimal between two consecutive runs of critical section.

Empirical Evaluation of Mutual Exclusion Algorithms for Distributed Systems

Journal of Parallel and Distributed Computing, 2000

Mutual exclusion in distributed memory systems is realized by passing messages among sites to establish a sequence for the waiting sites to enter the critical section. We have evaluated various distributed mutual exclusion algorithms on the IBM SP2 machine and the Intel iPSCÂ860 system, with their empirical results compared in terms of such criteria as the number of message exchanges and response time. The results take into account the effects of critical section request rate, critical section duration, and system size. Our results indicate that the Star algorithm (1991, M. L. Neilsen and M. Mizuno, in``Proc. 11th Int. Conf. Distributed Computing Systems,'' pp. 354 360) achieves the shortest response time in most cases among all the algorithms on a small to medium-sized system, when sites request the critical section many times before involving any barrier synchronization. This is because (1) it requires the exchange of no more than three messages per critical section entry, and (2) contention can quickly be alleviated after several entries into

High-contention mutual exclusion by elevator algorithms

Concurrency and Computation: Practice and Experience, 2018

This paper presents new starvation-free hardware-assisted and software-only algorithms for the N-thread mutual-exclusion problem. The hardware-assisted versions use a single atomic-CAS instruction and no fences. The software-only algorithms simulate the CAS instruction using a variation of Burns-Lamport (1 fence) or Lamport's fast algorithm (3 fences). The algorithms are based on Attiya et al, where every thread in the critical section chooses its successor (if one is available). While Attiya et al use a binary tree for this purpose, it can also be done with a linear search. Surprisingly, all software-only algorithms perform equally well under maximal contention on three different computer architectures; the hardware-assisted versions perform better under minimal contention. The new algorithms are between −5% to 50% slower for maximal contention than the starvation-free first-come first-served hardware-assisted MCS algorithm, which uses two atomic instructions (fetch-store and CAS); they are between 10% to 50% slower than MCS for minimal contention.

Efficient Mutual Exclusion Algorithm Aasim khurshid

2012

This paper presents an algorithm that can solve the problem in single processing, multiprocessing and distributed systems efficiently with minimal changes. For distributed systems we introduce message passing service while keeping rest of the mechanism same works faster than many other algorithms for distributed systems. Due to this multiple processes can execute in different critical sections concurrently. Performance of the algorithm is analyzed in terms of memory and time.