摘要:
A method of and apparatus for executing a family of instructions provides synchronization of processes in a multiprocessing system. Representations of processes awaiting data (information units) such as the completion of an asynchronous operation or the availability of a resource are stored in a memory in a first queue and representations of information units available to processes are stored in memory in a second queue. Transfer of information units between processes is controlled by data elements known as "semaphores" stored in the memory. Each semaphore contains a field having a numerical value identifying which of the two different kinds of queues is present. When a P instruction is executed by a process indicating that the process requires data in order to continue operating or a V instruction is executed indicating that an information unit is available for transfer to another process, a semaphore is addresses and its field tested to determine whether processes or information units are available to enable the information transfer between processes to be effected. Once the information transfer is completed, the field of the addressed semaphore is up-dated.
摘要:
An information structure, or semaphore, serves as a signalling mechanism in process synchronization to connect a process and a non-simultaneously occurring event or resource. The semaphore is a data structure which stores representations of processes awaiting particular events or alternatively stores representations of events awaiting processes. Semaphore data structures are developed in two storage areas. First and second groups of process links are stored in the first storage area to establish, respectively, a first queue of processes ready to operate and a second queue, associated with the semaphore structure, of processes awaiting occurrences of a first particular event prior to being ready to operate. In the second storage area are stored first and second groups of message links to establish respectively a first queue, associated with a semaphore structure, representing second particular events and a second queue of unused links. A signal is generated in response to operation of a first process to denote the occurrence of a first event. In response to the signal, the first event is associated with a process represented by a process link in the second queue of process links when the first event is the first particular event. When no queue has a process link identifying a process awaiting the occurrence of the first event, a representation of the first event occurrence is stored in a message link of the second queue of message links to be transferred to the first queue of message links. Process and event occurrence representations are thus transferred among the process and event queues during synchronization that takes place between the processes and events.
摘要:
Synchronization of processes in a multiprogramming/multiprocessing system is provided by P and V instructions that are executed during execution of processes and operate on data structures known as semaphores which represent processes and events. A process that performs P instruction requests data. The P instruction addresses a semaphore data structure stored in memory. If the semaphore indicates that the data is available, the process continues execution of its next instruction; otherwise, the process is stopped and placed into a wait state until the data become available. A process that performs a V instruction, on the other hand, delivers data to another process. The V instruction addresses a semaphore to determine whether another process is awaiting the data and data are transferred to an awaiting process. If no process is available, the V instruction enables one of the processes in the wait state tied to the same addressed semaphore to be transferred to the ready state. P and V instructions are provided for semaphore structures without messages as well as semaphore structures with messages. Each of the P and V instructions includes test instructions that enable a process to continue in the running state in the event that the test P or V instruction is unable to be executed.
摘要:
An information structure called a semaphore serves as a signalling mechanism in process synchronization. The semaphore is used to relate a process and an event which do not appear simultaneously. In accomplishing this, the semaphore is capable of storing the presence of events or resources waiting for processes or, alternatively, the presence of processes waiting for events or resources via a queue.