VP : A new operation for semaphores

A semaphore is a non-negative integer variable on which only operations P and V are allowed. The semaphore construct (with various extensions) is supported by many operating systems and is often used to implement other synchronization constructs. Since the semaphore construct is low-level, a semapho...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Operating systems review 1996-07, Vol.30 (3), p.5-11
Hauptverfasser: TAI, K. C, CARVER, R. H
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:A semaphore is a non-negative integer variable on which only operations P and V are allowed. The semaphore construct (with various extensions) is supported by many operating systems and is often used to implement other synchronization constructs. Since the semaphore construct is low-level, a semaphore-based program may contain synchronization errors that are very difficult to detect. In this paper, we propose a new operation VP (s1,s2), where s1 and s2 are distinct or identical semaphores. An execution of VP(s1,s2) by a process T is equivalent to that of "V (s1); P(s2)" except that when T starts the V (s1) operation, T is guaranteed to be the next process to access s2 (i.e., T will execute the P(s2) operation before another process executes a P(s2) or V(s2) operation.) Section 2 shows several examples to illustrate the advantages of the VP operation. Section 3 concludes this paper. In this paper, we assume that the queue for a semaphore is first-in-first-out and that the order of processes blocked in a semaphore queue is the same order in which they executed P operations on the semaphore. We also assume that the scheduling of processes in a concurrent program is fair, i.e., each process ready for execution will eventually be selected as the running process. Programs in this paper use Ada-like syntax.
ISSN:0163-5980
1943-586X
DOI:10.1145/230908.250717