Method using semaphores for synchronizing communication between programs or processes resident in a computer system
First Claim
Patent Images
1. In a computer system having an operating system which supports shared memory and semaphores, a computer-implemented method for communicating a message from one program to another program both resident in the computer system including the following steps:
- at one of said programs having a message to send to the other;
requesting a message semaphore from the operating system;
upon receiving the message semaphore from the operating system placing the message in a predetermined slot in the shared memory;
thereafter requesting a queue semaphore from the operating system;
upon receiving the queue semaphore from the operating system adding an indicia of the location of the said predetermined slot in the said shared memory in a queue located in the said shared memory; and
,thereafter clearing the message and queue semaphores requested from the operating system and a wakeup semaphore which has been previously set by the other program whereby the other program is, upon the clearing of the wakeup semaphore, enabled to access the message in the predetermined slot in the shared memory.
1 Assignment
0 Petitions
Accused Products
Abstract
A communication method suitable for use between programs operating at different privilege levels in a processor utilizes shared memory which includes a plurality of memory slots for containing messages to be exchanged and message queue. The synchronization of the programs and access to the shared memory is controlled a number of semaphores. Each slot is provided with its own semaphore ana three additional semaphores are provided to synchronize operation.
-
Citations
11 Claims
-
1. In a computer system having an operating system which supports shared memory and semaphores, a computer-implemented method for communicating a message from one program to another program both resident in the computer system including the following steps:
-
at one of said programs having a message to send to the other; requesting a message semaphore from the operating system; upon receiving the message semaphore from the operating system placing the message in a predetermined slot in the shared memory; thereafter requesting a queue semaphore from the operating system; upon receiving the queue semaphore from the operating system adding an indicia of the location of the said predetermined slot in the said shared memory in a queue located in the said shared memory; and
,thereafter clearing the message and queue semaphores requested from the operating system and a wakeup semaphore which has been previously set by the other program whereby the other program is, upon the clearing of the wakeup semaphore, enabled to access the message in the predetermined slot in the shared memory. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. In a computer system having an operating system which supports shared memory and semaphores, a computer implemented method of exchanging messages between programs resident in the computer system including the following steps:
-
at one of said programs, having a message requiring a response to send to the other; requesting a message semaphore from the operating system; upon receiving the message semaphore from the operating system placing the message in a predetermined slot in the shared memory; thereafter requesting a queue semaphore from the operating system; upon receiving the queue semaphore adding an indicia of the location of the said predetermined slot in the said shared memory in a queue located in the said shared memory; setting a slot semaphore in the shared memory which corresponds to the said predetermined slot; clearing the message and queue semaphores, requested from the operating system, and a wakeup semaphore and inhibiting further message processing until the slot semaphore is reset; monitoring the slot semaphore and processing a reply message in the said predetermined slot when the previously set slot semaphore is cleared; and
, freeing the said predetermined slot once the message is processed;at the said other program setting the said wakeup semaphore at initialization or upon completion of the processing of a received message, monitoring the wakeup semaphore and initiating the processing of a message when the wakeup semaphore is cleared, including the following steps; requesting the queue semaphore from the operating system and removing the first indicia in the queue indicating the location of the slot containing a message in the shared memory; clearing the queue semaphore; getting the message using the indicia removed from the queue and process the message; placing a reply in the slot corresponding to the slot indicia and clearing the corresponding slot semaphore; and
,setting the wakeup semaphore and inhibiting further message processing until the wakeup semaphore has been cleared. - View Dependent Claims (8, 9, 10, 11)
-
Specification