Interprocess communication using a single semaphore
First Claim
1. A computer program product to enable communication between a plurality of processes, the computer program product comprising a non-transitory computer readable storage medium having computer-usable program code embodied therein, the computer-usable program code comprising:
- computer-usable program code to initiate a plurality of processes, the plurality of processes comprising both attachment processes and target processes;
computer-usable program code to create and initialize a single semaphore for use by the plurality of processes, such that each of the target processes are initially blocked by the semaphore;
computer-usable program code to write a message file to a location readable by each of the target processes and identifying a specific target process with which an attachment process wants to establish a connection;
computer-usable program code to increment the semaphore by the number of target processes, thereby unblocking each of the target processes and allowing each of the target processes to read the message file and thereby determine if it is the target process identified in the message file;
computer-usable program code to establish a connection between the attachment process and the specific target process identified in the message file; and
computer-usable program code to decrement the semaphore to zero, thereby blocking each of the target processes.
2 Assignments
0 Petitions
Accused Products
Abstract
A method to enable communication between software processes includes initiating a plurality of processes, the processes including both attachment processes and target processes. A single semaphore is created and initialized for use by the plurality of processes such that each of the target processes wait on the semaphore. An attachment process writes a message file, identifying a specific target process, to a location accessible by the target processes. The attachment process then increments the semaphore by the number of target processes, thereby unblocking the target processes and allowing them to check the message file. When the specific target process determines that the message file is intended for that target, a connection is established between the attachment process and the specific target process. The attachment process then decrements the semaphore to zero to block the target processes. A corresponding computer program product and apparatus are also disclosed herein.
-
Citations
14 Claims
-
1. A computer program product to enable communication between a plurality of processes, the computer program product comprising a non-transitory computer readable storage medium having computer-usable program code embodied therein, the computer-usable program code comprising:
-
computer-usable program code to initiate a plurality of processes, the plurality of processes comprising both attachment processes and target processes; computer-usable program code to create and initialize a single semaphore for use by the plurality of processes, such that each of the target processes are initially blocked by the semaphore; computer-usable program code to write a message file to a location readable by each of the target processes and identifying a specific target process with which an attachment process wants to establish a connection; computer-usable program code to increment the semaphore by the number of target processes, thereby unblocking each of the target processes and allowing each of the target processes to read the message file and thereby determine if it is the target process identified in the message file; computer-usable program code to establish a connection between the attachment process and the specific target process identified in the message file; and
computer-usable program code to decrement the semaphore to zero, thereby blocking each of the target processes. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. An apparatus to enable communication between a plurality of processes, the apparatus comprising:
-
at least one processor; at least one memory device operatively coupled to the at least one processor and storing modules for execution on the at least one processor, the modules comprising; an initiation module to initiate a plurality of processes, the plurality of processes comprising both attachment processes and target processes; a creation module to create and initialize a single semaphore for use by the plurality of processes, such that each of the target processes are initially blocked by the semaphore; a write module to write a message file to a location readable by each of the target processes and identifying a specific target process with which an attachment process wants to establish a connection; an increment module to increment the semaphore by the number of target processes, thereby unblocking each of the target processes and allowing each of the target processes to read the message file and thereby determine if it is the target process identified in the message file; a connection module to establish a connection between the attachment process and the specific target process identified in the message file; and a decrement module to decrement the semaphore to zero, thereby blocking each of the target processes. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
Specification