Apparatus and method for semaphore initialization in a multiprocessing computer system for process synchronization
First Claim
1. In a data processing apparatus wherein a queue of representations of processes awaiting the occurrence of a particular kind of event are stored in a memory member of said system, wherein a data element in the form of a semaphore is held in the memory member of said system, said data element having a tally field representing depending on its value one of (a) the number of process representations in said queue and (b) the number of times said particular kind of event has occurred or the number of resources awaiting processes, said tally field being decremented by one when a process requests a resource and incremented by one when either an event occurs or a resource is awaiting processes and wherein said apparatus during the execution of a process executes instructions of a particular class, a system for selectively initializing the data element or returning the data element to a preloaded value depending upon semaphore type, comprising:
- retrieving means controlled by one of said instructions for retrieving said data element from the memory member;
testing means for testing the tally field of the data element retrieved from the memory member and in response generating a first signal when said tally field represents the number of process representations in said queue and a second signal when said tally field represents either the number of times said particular kind of events has occurred or the number of resources awaiting processes;
initializating means responsive to said second signal and controlled by said one instruction for changing the number represented by said tally field either to zero when the tally field represents the number of times said particular kind of event has occurred or to a preloaded zero or positive value when the tally field represents the number of resources awaiting processes; and
control means responsive to said first signal and controlled by said one instruction for controlling said apparatus to cease execution of said one instruction and to commence executing a different instruction.
0 Assignments
0 Petitions
Accused Products
Abstract
Apparatus in a data processing system to initialize a semaphore held in a memory field of the data processing system or, alternatively, to restore the semaphore to a previous predetermined state. A count field, or tally field, provided in the semaphore is initialized by a particular instruction. The semaphore can be either a non-message semaphore or a message semaphore. The instruction initializes the semaphore count field of a non message semaphore to zero or a preloaded positive value. For a message semaphore, this instruction initializes the count field to zero. If the message semaphore previously had a positive count, the messages tied to the semaphore are released and the message links holding the messages are transferred to a free message link queue tied to the free link semaphore in the same semaphore descriptor segment. The apparatus includes a retrieving member for reading the content of the semaphore in the memory of the data processing system, a testing member for testing the count field of the semaphore for generating a first signal when the count field represents the number of processes in queue and a second signal when the count field represents the number of times a particular kind of event has occurred, a changing unit responsive to the second signal and controlled by the particular instruction for changing the number inside the count field to a predetermined number and a control member responsive to the first signal and controlled by the particular instruction for controlling the data processing system to cease execution of the particular instruction and to begin to execute a different instruction.
-
Citations
7 Claims
-
1. In a data processing apparatus wherein a queue of representations of processes awaiting the occurrence of a particular kind of event are stored in a memory member of said system, wherein a data element in the form of a semaphore is held in the memory member of said system, said data element having a tally field representing depending on its value one of (a) the number of process representations in said queue and (b) the number of times said particular kind of event has occurred or the number of resources awaiting processes, said tally field being decremented by one when a process requests a resource and incremented by one when either an event occurs or a resource is awaiting processes and wherein said apparatus during the execution of a process executes instructions of a particular class, a system for selectively initializing the data element or returning the data element to a preloaded value depending upon semaphore type, comprising:
-
retrieving means controlled by one of said instructions for retrieving said data element from the memory member; testing means for testing the tally field of the data element retrieved from the memory member and in response generating a first signal when said tally field represents the number of process representations in said queue and a second signal when said tally field represents either the number of times said particular kind of events has occurred or the number of resources awaiting processes; initializating means responsive to said second signal and controlled by said one instruction for changing the number represented by said tally field either to zero when the tally field represents the number of times said particular kind of event has occurred or to a preloaded zero or positive value when the tally field represents the number of resources awaiting processes; and control means responsive to said first signal and controlled by said one instruction for controlling said apparatus to cease execution of said one instruction and to commence executing a different instruction. - View Dependent Claims (2, 3, 4)
-
-
5. In an electronic data processing apparatus of the type including data elements in the form of semaphores stored in a memory member wherein a queue of representations of processes awaiting the occurrence of a particular kind of event are held in a memory member of said apparatus, each of said data elements having a tally field representing depending upon its value one of (a) the number of process representations in said queue and (b) the number of times said particular kind of event has occurred or the number of resources awaiting processes, a method of initializing said data elements or returning said data elements to a preloaded value depending upon semaphore type, comprising the steps of:
-
retrieving said data element from the memory member; testing the tally field of the data element retrieved from the memory member and in response generating a first electrical signal when said tally field represents the number of process representations in said queue and a second electrical signal when said tally field represents either the number of times said particular kind of events has occurred or the number of resources awaiting processes; in response to said second signal, changing the number represented by said tally field either to zero when the tally field represents the number of times said particular kind of event has occurred or to a preloaded zero or positive value when the said tally field represents the number of resources awaiting processes; and in response to said first signal, ceasing execution of said method. - View Dependent Claims (6, 7)
-
Specification