Abstract: A system and method for implementing signaling mechanism in an inter process environment have been disclosed. The system provides for instructing a reader module reading inter process messages from a queue to suspend reading from the queue when the queue is empty. It also provides for instructing the reader module to resume reading inter process messages form the queue when it is determined that the queue has received at least one inter process message.
FORM-2
THE PATENTS ACT, 1970
(39 of 1970)
&
THE PATENTS RULES, 2006
COMPLETE SPECIFICATION
(See section 10 and rule 13)
A SYSTEM AND METHOD FOR IMPLEMENTING SIGNALING MECHANISM IN AN INTER PROCESS COMMUNICATION
ENVIRONMENT
TATA CONSULTANCY SERVICES LTD.
an Indian Company of Nirmal Building, 9th floor, Nariman Point, Mumbai 400021, Maharashtra, India
The following specification particularly describes the invention and the manner in which it is to be performed.
This application is a patent of addition to Indian Patent Application No. 966/MUM/2009 filed on April 13th, 2009, the entire contents of which are specifically incorporated herein by reference.
FIELD OF THE INVENTION
The present invention relates to the field of inter process communication between two processes executed either on the same computer terminal or different computer terminals.
Particularly, this invention relates to the field of implementing a signaling mechanism between processes executed in an inter process communication environment.
DEFINITIONS OF TERMS USED IN THE SPECIFICATION
In this specification the term 'throughput' refers to the number of 'read' or 'write' operations that can be performed on a message queue per second.
In this specification the term 'latency' refers to the time elapsed between sending a message by the sender process and receiving of the message by the receiver process.
In this specification the term 'queue' refers to a data structure in which data items can be stored and subsequently retrieved.
In this specification the term 'System V message queue' refers to a data structure which is used as a signaling channel to instruct a reader module to suspend reading from a queue when the queue is empty and to instruct the
reader module to resume reading inter process messages from the queue when the queue receives at least one inter process message.
In this specification the term ' Linux futex based system call' refers to system calls used to instruct a reader module to suspend reading from a queue when the queue is empty and to instruct the reader module to resume reading from the queue when the queue receives at least one inter process message.
In this specification the term 'Lima futex based variable' refers to a variable whose value is updated by Linux futex based system calls.
BACKGROUND OF THE INVENTION
In a computing environment, messaging systems are used for facilitating inter process communication between various processes. Messaging systems are typically used to facilitate transfer of messages that contain data to be exchanged between processes. Messaging systems of the prior art used locked queues for storing messages coming from various processes, and as a result suffered from the drawback of slow operation,
Particularly, US patent no. 6029205 disclosed a system and method for inter process communication between concurrently executing, cooperating sequential processes using shared memory qubeue as a mechanism for message passing and process synchronization. The sending process stored the message as a new entry in queue (the process referred to as en-queue operation), which is visible in the virtual address Space of a first process, and a receiving process read the message from the queue and performs the de-queue operation.
US patent application 20050021622 disclosed a system for dynamic message routing on a topic between publishing nodes and subscribing nodes includes a plurality of message queues, at least one topic node table, a subscribing module, a publishing module, and other modules to send messages between one or more publisher and one or more subscribers. This application focused on the feature of routing a message over a computer network to a plurality of subscribers and did not teach implementing a lock less queue mechanism.
Therefore, with the intent of overcoming the disadvantages associated with the systems of the prior art, India Patent Application 966/MUM/2009 disclosed a system which implemented lock less message queue mechanism thereby providing for multiple processes to communicate simultaneously. In this system, the messages supposed to be exchanged between the processes were stored in a lock less queue and the processes accessed the lock less queue to write the messages into the queue as well as read the messages from the queue, but implementation of this system entailed higher levels of CPU utilization. Higher levels of CPU utilization do not create computational overheads when there are large numbers of messages waiting in the lockless queue to be exchanged. But when there were only a few messages or no messages to be exchanged between the processes, the processes that accessed the lock less queue to read the messages used to shift to waiting mode and spin in a busy loop, thereby utilizing the computational capabilities of the CPU, resulting in 100% CPU utilization, even though they were not reading any messages from the lockless queue.
Such a phenomenon of process spinning in a busy loop while waiting for the lockless queue to receive inter process messages, thereby utilizing the CPU
to the fullest possible extent, i.e., 100% CPU Utilization but not performing any productive computational activity, resulted in creation of substantial performance/computational overheads.
Hence, there is a need of a system and method to overcome one or more drawbacks associated with the above mentioned prior art.
OBJECTS OF THE INVENTION
It is an object of the present invention to provide a system that selectively deactivates the processes that are waiting to read from the queue when it is determined that the queue is empty.
Another object of the present invention is to provide a system that reduces the CPU utilization, by suspending the processes waiting for the queue to receive inter process messages.
Yet another object of the present invention is to provide a system that selectively activates the suspended processes when the queue receives any message to be read.
Still further object of the present invention is to provide a system that increases the efficiency associated with inter process communication.
Yet another object of the present invention is to provide a system that ensures optimal CPU utilization.
Further object of the present invention is to provide a system that provides best possible results in terms of the message throughput, CPU utilization and latency associated with inter process communication.
Another object of the present invention is to provide a system that makes use of advanced signaling techniques to rapidly suspend the processes and subsequently reactivate the suspended process.
Yet another object of the present invention is to provide a system that ensures that there is no deadlock between the process writing into the queue and process reading from the queue.
SUMMARY OF THE INVENTION
In accordance with the present invention, a system for implementing signaling mechanism in an inter process communication environment is provided. The system, in accordance with the present invention includes the following components:
• a queue of storage buffers adapted to be concurrently accessed by a plurality of processes, the queue further adapted to receive and store inter process messages;
• a reader module adapted to generate a suspend signal and suspend accessing said queue when queue is empty, said reader module further adapted to resume accessing said queue when said queue receives at least one inter process message; and
• a writer module adapted to generate and transmit a wake up signal to the reader module after writing at least one inter process message into the queue.
Typically, in accordance with the present invention, the queue contains a cyclic linked list of storage buffers.
Typically, in accordance with the present invention, the system further includes a determination module adapted to determine whether the queue is empty.
Typically, in accordance with the present invention, the writer module further includes a checking module adapted to check whether the reader module has suspended accessing the queue.
Typically, in accordance with the present invention, the wake up signal generated and transmitted by the writer module to the reader module is selected from the group consisting of control message and Linux futex based system call.
Typically, in accordance with the present invention, the control message generated and transmitted by the writer module is stored in a System V message queue.
Typically, in accordance with the present invention, the reader module is adapted to suspend accessing the queue and resume accessing the queue based on whether System V message queue is storing the control message generated and transmitted by the writer module.
Typically, in accordance with the present invention, the reader module is adapted to suspend accessing the queue and resume accessing the queue,
based on whether the Linux futex based system call generated and transmitted by the writer module has updated the value stored in Linux futex based variable.
Typically, in accordance with the present invention, every storage buffer in said queue is linked to the next storage buffer and the last storage buffer is linked to the first storage buffer forming circular linked list for storing the messages into storage buffers.
In accordance with the present invention, there is provided a method for implementing signaling mechanism in an inter process communication environment. The method, in accordance with the present invention includes the following steps:
• identifying a queue of storage buffers for storing inter process
messages wherein the queue is accessed by a plurality of processes;
• determining whether the queue is empty;
• suspending accessing said queue if it is determined that the queue
is empty;
• writing at least one inter process message into said queue and
generating, transmitting a wake up signal; and
• resuming accessing said queue in response to the wake up signal.
Typically, in accordance with the present invention, the step of determining whether the queue is empty includes the step of determining whether the data pointing element denoting the storage buffer containing an inter process
message and free pointing element denoting a free storage buffer are pointing to the same storage buffer.
Typically, in accordance with the present invention, the step of writing at least one inter process message into the queue and generating and transmitting a wake up signal further includes the step of generating and transmitting a wake up signal selected from the group consisting of control message and Linux futex based system call.
Typically, in accordance with the present invention, the step of resuming accessing the queue in response to the wake up signal further includes the step of resuming accessing the queue based on wake up signal selected from the group consisting of control message and Linux futex based system call.
BRIEF DESCRIPTION OF THE ACCOMPANYING DRAWINGS
The invention will now be described in relation to the accompanying
drawings in which,
Figure 1 illustrates by the way of example, a first embodiment of the system
for implementing signaling mechanism between at least two processes
executed in an inter process communication environment, in accordance
with present invention;
Figure 2 illustrates by the way of example, a second embodiment of the
system for implementing signaling mechanism between at least two
processes executed in an inter process communication environment, in
accordance with present invention;
Figure 3 illustrates a flowchart for the method of implementing signaling mechanism between at least two processes executed in an inter process communication environment, in accordance with the present invention; Figure 4 illustrates a graph showing the comparison between message throughput achieved by the system of present invention and system of prior art; and
Figure 5 illustrates a graph showing the comparison between CPU utilization levels achieved by the system of present invention and system of prior art.
DETAILED DESCRIPTION
The present invention will now be described in detail with reference to the accompanying drawings. The description and drawings do not limit the scope and ambit of the invention and are provided purely by way of example and illustration.
The prior art does not teach providing a system for managing inter process communication in such a way that the CPU utilization is minimized when the message queue is empty. Thus, the present invention proposes a system and method by which the CPU utilization can be minimized by temporarily suspending the processes waiting to read from the message queue, when the message queue is empty.
As mentioned in the prior art, when the message queue is empty, the process reading from the message queue entered into a busy loop, waiting for the message queue to receive at least one readable inter process message, thereby consuming the computational power of the CPU and causing an
increase in the levels of CPU utilization, but not performing any productive computational activity.
Since the process entering the busy loop and waiting for the message queue to receive inter process messages did not perform other productive computational activity but utilized the resources of the computing system, additional computational overheads were created and subsequently the performance of the computing system was adversely affected.
Therefore, in order to prevent creation of additional computational overheads and to prevent unnecessary utilization of computational capabilities of the CPU and to bring down the levels of CPU Utilization when the message queue has no readable inter process messages, it is desirable to instruct the process trying to read from the message queue to temporarily suspend reading from the queue.
In accordance with the present invention, the messaging system facilitating inter process communication is implemented in files. These files contain queues i.e. data structure storing the inter process messages. The files containing queues are typically mapped into the main memory space of the processor for swift access. A queue is a collection of storage buffers and every storage buffer is linked to next storage buffer and the last storage buffer is linked to first storage buffer forming a circularly linked list for storing all the incoming messages into the storage buffers one after another. Also, the queue has two types of pointing elements i.e. free pointing element and data pointing element.
The queue, in accordance with the present invention has a free pointing element which points to a free storage buffer in which a next incoming message can be stored and is always associated with the process writing inter process messages into the queue. The free pointing element always points to the storage buffer that is empty and ready to store the next incoming message. The message coming into the queue is always inserted into the empty storage buffer that is pointed to by the free pointing element.
The queue also has a data pointing element which always points to the next storage buffer from which a pre stored message can be read and is always associated with the process which reads inter process messages from the queue. In case of multiple processes reading from the same queue, multiple data pointing elements can be employed for reading messages from the queue where each of the data pointing element is associated with respective reading processes.
Also, the position of free end pointing element and data pointing elements is used to check whether the queue is empty i.e. has no message stored in any of the storage buffers or if it is full i.e. all the storage buffers of the queue have messages stored in them to be read by one or more processes. In the case of a queue associated with only one process reading from the queue and only one process writing into the queue, which is typically the case in a point to point queue, it is checked to be full or empty by locating the position of the free pointing element and the data pointing element. The procedure utilized to check whether a queue is empty or not is provided below:
• If the data pointing element and the free pointing element points to the same storage buffer the queue is empty.
• If the storage buffer pointed to by the free pointing element has its
next buffer pointed to by the data pointing element then the queue is
full.
The system of the present invention makes use of the following variables while instructing the reader module to suspend accessing the queue and resume accessing the queue:
• 'tmq_no_inserts': this variable holds the value corresponding to the total number of inter process messages inserted/written into the queue;
• 'tmq_no_deletes': this variable holds the value corresponding to the total number of inter process messages read from the queue;
• 'tmq_reader wait': is a Boolean variable, when initialized with the value 'true', this variable indicates that the reader module has suspended accessing the queue and is waiting for the control signal from the writer module. When initialized to the value 'false', this variable indicates that the reader module has resumed accessing the queue; and
• 'tmq_suspend_receiver': is a Boolean variable, when initialized with the value 'true', this variable indicates that the reader module has suspended accessing the queue and is waiting for the control signal from the writer module. When initialized to the value 'false', this variable indicates that the reader module has resumed accessing the queue
These variables are adapted to be accessed by both reader module as well as the writer module and always stored in shared memory space to facilitate access to both reader module as well as writer module.
Figure 1 illustrates, by the way of example, a first embodiment of the present invention. A system 100, in accordance with the first embodiment of the present invention can be implemented on operating systems such as Linux operating system and UNIX operating system. The system 100, in accordance with the first embodiment of the present invention includes a queue 12 which is, for example, a cyclic queue of storage buffers, a reader module 14, a writer module 16, determination means 18 and system V . message queue 20.
In accordance with the present invention, the queue 12 can be concurrently accessed by a plurality of processes for the purpose of reading inter process messages. Queue 12 is capable of receiving inter process messages and storing the received inter process messages. Queue 12 is associated with a free pointing element which always points to the free (empty) storage buffer in which a next incoming inter process message can be stored. The free pointing element is utilized by writer module 16 for the purpose of identifying the position of the empty storage buffer into which a new inter process message can be written (stored). Queue 12 also associated with a data pointing element which always points to the storage buffer from which the inter process message has to be read. The data pointing element is utilized by the reader module 14 for the purpose of identifying the storage buffer from which the inter process message is to be read.
In accordance with the present invention, the reader module 14 is adapted to read inter process messages inserted into the queue 12 by the writer module 16. The reader module 14 makes use of the data pointing element associated with the queue 12, accesses the storage buffer whose position was identified by the data pointing element and reads the inter process message from the queue 12 and from the storage buffer identified by the data pointing element.
The reader module 14, in accordance with the present invention is adapted to suspend accessing the queue 12 when it is determined that the queue 12 is empty and that it does not hold any readable inter process messages. The reader module 14 cooperates with the determining means 18 to determine whether queue 12 empty.
In accordance with the present invention, the writer module 16 is adapted to write inter process messages into the queue 12. The writer module 16 makes use of the free pointing element associated with the queue 12, accesses the storage buffer whose position was identified by the free pointing element and writes the inter process message into the queue 12 and into the storage buffer identified by the free pointing element. The writer module 16 includes a checking means (not shown in figures) which is adapted to determine whether the reader module 14 has suspended accessing and reading inter process messages from the queue 12.
In accordance with the present invention, the reader module 14 suspends accessing the queue 12 when there are no inter process messages in the queue 12 and subsequently resumes accessing and reading inter process messages from the queue 12 when it is determined that the queue 12 has
received at least one inter process message. The system 100 makes use of, for example, a System V message queue denoted by reference numeral 20 for the purpose of instructing the reader module 14 to resume accessing the queue 12.
In accordance with the present invention, after writing an inter process message into the queue 12, the writing module 16, through the checking means checks whether reader module 14 has suspended accessing the queue. If it is determined that the reader module 14 has suspended accessing the queue 12, the writer module 16 generates a wake up signal indicating that it has written an inter process message into the queue 12. The wake up signal via writing a control message in System V message queue 20 generated by the writer module is not directly sent to the reader module 14, instead it is received by the System V message queue 20. The System V message queue 20, after receiving the wake up signal from the writer module 16, instructs the reader module 14 to resume accessing and reading inter process messages from the queue 12. The wake up signal received by the System V message queue 20 is in the form of a control message.
In accordance with the present invention, when queue 12 is empty, the determining means 18 communicates to the reader module that the queue 12 is empty. The reader module 14 soon after receiving the indication from determining means 18 initializes the 'tmq_reader_wait' flag to value 'true' and accesses the System V message queue 20 and checks for the presence of control messages from writer module 16. If there are no control messages in the System V message queue 20, the reader module initializes a variable, for example, 'q_wr_seq' with the value stored in the variable 'tmq_no_inserts'
and suspends accessing queue 12. By initializing the flag 'tmq_reader_wait' to true, the reader module 14 indicates that it has suspended accessing queue 12.
The writer module 16, after writing an inter process message into queue 12, checks through checking means, whether the reader module 14 has suspended accessing queue 12. The checking means accesses the flag 'tmq_reader_wait' and if the value of the flag is set to 'true', concludes that reader module 14 has indeed suspended accessing queue 12. subsequently the writer module 16 generates and transmits a wake up signal in the form of a control message to the System V message queue 20 indicating that it has written at least one inter process message into queue 12. The control message inserted into the System V message queue 20 includes the latest value of the variable 'tmq_no_inserts'. Since writer module 16 has inserted at least one inter process message into queue 12, the value of the variable 'tmq_no_inserts' is incremented by at least' 1 Soon after a control message is inserted into the System V message queue 20 by the writer module 16, the reader module 14 accesses the control message and initializes the latest value of the variable 'tmq_no inserts' sent through the control message to a variable 'q_wr_seq' The reader module 14 subsequently compares the values stored in the variables 'wr_seq' and 'q_wr_seq' and since the value stored in the variable 'q_wr_seq' is greater than the value stored in the variable 'wrseq' by at least '1', the reader module resumes accessing the queue 12 and resumes reading inter process messages from queue 12.
After resuming accessing the queue 12, the reader module 14 resets the flag 'tmq_reader_wait' to 'false' in order to inform the writer module 16 that it has resumed reading inter process messages form queue 12 and there is no necessity of inserting another control message into the System V message queue 20.
Figure 2 illustrates, by the way of example, a second embodiment of the present invention. The system 200 in accordance with the second embodiment of the present invention can be implemented on operating systems such as Linux operating system. The system 200, in accordance with the second embodiment of the present invention includes a queue 22 which is, for example, a cyclic queue of storage buffers, a reader module 24, a writer module 26, determination means 28 and Linux futex based variable 30.
The configuration, characteristics and implementation of the queue 22 are similar to the configuration, characteristics and implementation of the queue explained in the first embodiment. The free pointing element associated with queue 22 is utilised by the writer module 26 for the purpose of identifying the position of the empty storage buffer into which a new inter process message can be written (stored). The data pointing element associated with queue 22 is utilised by the reader module 24 for the purpose of identifying the storage buffer from which the inter process message is to be read. The reader module 24 is adapted to read inter process messages inserted into the queue 22 by the writer module 26. The reader module 24 is adapted to suspend accessing the queue 22 and suspend reading inter process messages from the queue 22, when it is determined by the determining means 28 that
the queue 22 is empty. The reader module 24 cooperates with the determining means 28 and based on the instructions provided by the determining means 28 decides whether to continue accessing the queue 22 or to suspend accessing the queue 22.
The writer module 26 is adapted to write inter process messages into the queue 22. The writer module 26 also includes a checking means (not shown in figures) which is adapted to determine whether the reader module 24 has suspended accessing and reading inter process messages from the queue 22.
The Linux futex based variable 30 performs the task of a control channel by instructing the reader module 24 to suspend accessing the queue 22 when there are no inter process messages in the queue 22 and subsequently instructing the reader module 24 to resume accessing and reading inter process messages from the queue 22 when it is determined that the queue 22 has received at least one inter process message.
In accordance with the present invention, based on the manipulation of the value stored in the Linux futex based variable 30, more particularly, depending upon, whether the value stored in the Linux futex based variable is updated by the Linux futex based system call 'FUTEXWAKE', the reader module 24 is instructed to resume accessing the queue 22.
The system 200 in accordance with second embodiment of the present invention makes use of Linux futex system calls to instruct reader module 24 to suspend accessing the queue 22 and also to instruct reader module 24 to resume accessing the queue 22 and resume reading inter process messages
from the queue 22. More particularly, Linux futex system calls are used in the system 200 for the following purposes:
• To instruct the reader module 26 to suspend accessing the queue 22 whenever it is determined that queue 22 is empty; and
• to instruct the reader module 26 to resume accessing the queue 22 as soon as the value stored in the Linux futex based variable 30A is incremented.
In accordance with the present invention, Linux futex system call 'FUTEX_WAIT' is utilized to instruct the reader module 24 to suspend accessing the message queue 22. Similarly, the system call 'FUTEX_WAKE' is utilized to signal (instruct) the reader module 24 to resume accessing the message queue 22 and resume reading inter process messages from the message queue 22 when it is determined that the queue 22 has received at least one readable inter process message.
In accordance with the present invention, when the determining means 28 determines, by comparing the positioning of free pointing element and data pointing element that the message queue 22 is empty, it instructs the reader module 26 to suspend accessing the queue 22. Prior to suspending accessing the queue 22, the reader module 24 initializes the Linux futex based variable named as, for example, 'uaddr' with the value stored in the variable 'tmq_no_inserts\ The variable 'tmq_no_inserts' holds the value corresponding to the total number of inter process messages inserted into the message queue 22.After initialing the variable 'uaddr' with the value corresponding to the total number of inter process messages inserted into the queue 22, the reader module 24 examines whether the value stored in the
variable 'uaddr' i.e., the value corresponding to the total number of inter process messages inserted into the queue 22 is equal to the value stored in the variable 'tmq_no_deletes'. The variable 'tmq_no_deletes' holds the value corresponding to the total number of inter process messages read from the queue 22. If both the values are equal, it means that all the inter process messages inserted into the queue 22 have already been read and there are no more readable inter process messages left in the queue 22. If the reading module 24 determines that both the values are equal, it concludes that queue 22 is empty and subsequently with the aid of the system call 'FUTEXWAIT' suspends accessing the queue 22.
Alternatively, the determining means 28, after determining that the queue 22 is empty, examines whether the values stored in the variables 'tmq_no_inserts' and 'tmq_no_deletes' are equal. The variable 'tmq_no_inserts' holds the value corresponding to the total number of inter process messages inserted into the message queue 22 and the variable 'tmq_no_deletes' holds the value corresponding to the total number of inter process messages read from the message queue 22 . Therefore if both the values are equal, it means that all the inter process messages inserted into the queue 22 have already been read and there are no more readable inter process messages left in the queue 22. Therefore, in the case of values stored in variables 'tmq_no_inserts' and 'tmq_no_deletes' being equal, the reader module 24, with the aid of the system call 'FUTEXWAIT' suspends accessing the queue 22. After suspending accessing the queue 22, the reader module 24 sets the flag 'tmq_suspend_receiver' to 'true* denoting that it has suspended accessing the message queue 22.
In accordance with the present invention, when , the writer module 28, inserts a new inter process message into the message queue 22, it cheeks using checking means, whether reader module has suspended accessing the queue 22. The checking means examines the status of the flag 'tmq_suspend_receiver' and checks whether the flag has been set to 'true'. If the flag is set to 'true', the checking means notifies the writer module 28 that the reader module 24 has suspended accessing the queue 22. Soon after receiving the notification form the checking means , the writer module 26 sends a wake up signal indicating to the reader module 24 that at least one inter process message has been inserted into queue 22 and instructs reader module 24 to resume accessing the queue 22 and resume reading the received inter process message.
The writer module 26 sends the wake up signal to the reader module 24 through the 'FUTEX_WAKE' system call. The 'FUTEX_WAKE' system call includes the updated value (updated value of the variable 'tmq_no_inserts') corresponding to the total number of" inter process messages inserted into queue 22. Soon after receiving the wake up signal through the 'FUTEX_WAKE' system call from the writer module 28, the reader module 24 checks the updated value corresponding to the total number of inter process messages inserted into queue 22, with the value previously stored in the Linux futex based variable 'uaddr'. As explained above, the variable 'uaddr' was initialized by the reader module 24 prior to suspending accessing the queue 22, with the value stored in 'uaddr' corresponding total number of inter process messages inserted into the queue 22. After reader module 24 initialized the variable 'uaddr' and suspended accessing the queue 22, at least one new inter process message was written
into the queue 22 by the writer module 28 and the value corresponding to the total number of inter process messages inserted into the queue 22 was updated by at least' 1' since at lest new inter process message was inserted. It is the updated value that has been sent to the reader module 24 through 'FUTEXWAKE' system call. Since the updated value corresponding to the total number of inter process messages inserted into queue 22, is greater than the value stored in the variable 'uaddr' by at lest '1' the reader module 24, after comparing the two values and after identifying the inequality between the two values resumes accessing the queue and resumes reading inter process messages from the queue 22.
Soon after receiving the instruction to resume accessing and reading inter process messages through the 'FUTEX_WAKE' system call, the reader module 24 sets the flag 'tmq_suspend_receiver' to 'false' denoting that it has resumed accessing and reading inter process messages inserted into the message queue 22 by the writer module 26.
Referring to Figure 3, a flow chart for the method for implementing a signaling mechanism in an inter process communication environment is shown. The method, in accordance with the present invention includes the following steps:
• identifying a queue of storage buffers for storing inter process
messages, wherein the queue is accessed by a plurality of processes 1000;
• determining whether the queue is empty 1002;
• suspending accessing said queue if it is determined that the queue
is empty 1004;
• writing at least one inter process message into said queue and
generating, transmitting a wake up signal 1006; and
• resuming accessing said queue in response to said wake up signal
1008.
In accordance with the present invention, the step of determining whether the queue is empty includes the step of determining whether the data pointing element denoting the storage buffer containing an inter process message and free pointing element denoting a free storage buffer are pointing to the same storage buffer.
In accordance with the present invention, the step of writing at least one inter process message into the queue and generating and transmitting a wake up signal further includes the step of generating and transmitting a wake up signal selected from the group consisting of control message and Linux futex based system call.
In accordance with the present invention, the step of resuming accessing the queue in response to the wake up signal further includes the step of resuming accessing the queue based on wake up signal selected from the group consisting of control message and Linux futex based system call.
EXPERIMENTAL DETAILS
Two processes, particularly, a writer process writing inter process messages into the queue and a reader process reading messages from the queue were utilized for the purpose of measuring the latency and message throughput achieved by the system of the present invention.
The test process included performing the following tests:
Full throttle tests: The writer process wrote messages into the message queue with no time delay between the writing/insertion of inter process messages. The reader process continuously read the inter process messages inserted into the queue and no time delay was associated with reading inter process messages from the queue. Figure 4 and Figure 5 illustrate the message throughput and CPU utilization achieved by the system respectively when full throttle test is performed on the system of the present invention,
Referring to Figure 4, it is shown that the system in accordance with the present invention achieves a message throughput of approximately 5.1 million with Linux futex based approach as well as System V message queue based approach. In Figure 4, the bar colored 'green' denotes the message throughput achieved when the system of the present invention is
implemented with System V message queues. The bar colored 'blue' denotes the message throughput achieved when the system of the present invention is implemented with a Linux futex based variable. The message throughput obtained by above mentioned approaches is greater than the message throughput achieved by the system of the prior art (denoted by the bar colored 'red')-
Referring to Figure 5, it is shown that the system in accordance with the present invention achieves minimum CPU utilization (the CPU utilization, as shown in the graph is in the range of 1% to 3%) when the message queue is empty, by suspending the processes which are spinning in a busy loop thereby utilizing the CPU time and for the queue to receive inter process messages. As shown in Figure 5, the system of the prior art entailed 100% CPU utilization (denoted by the bar colored in 'red')even when the message queue was empty, but the system of the present invention is able to reduce the CPU utilization by approximately 97% by temporarily suspending the processes waiting for the queue to receive inter process messages.
TECHNICAL ADVANCEMENTS
The technical advancements of the present invention include:
• providing a system that facilitates selective deactivation of the process
waiting to read from the queue when it is determined that the queue is
empty; • providing a system that reduces the percentage of CPU utilization
when the message queue is empty, by suspending the ones that are
waiting for the queue to receive the messages;
• providing a system that facilitates selective activation of the
suspended process when the queue receives readable inter process
messages;
• providing a system that increases the efficiency associated with inter process communication;
• providing a system that ensures optimal utilization of computational powers of the CPU;
• providing a system that endows best possible results in terms of the throughput, CPU utilization and latency associated with inter process communication;
• providing a system that makes use of advanced signaling techniques to rapidly suspend the processes and subsequently reactivate the suspended process; and
• providing a system that ensured that there is no deadlock between the process writing into the queue and process reading from the queue.
While considerable emphasis has been placed herein on the components and component parts of the preferred embodiments, it will be appreciated that many embodiments can be made and that many changes can be made in the preferred embodiments without departing from the principles of the invention. These and other changes in the preferred embodiment as well as other embodiments of the invention will be apparent to those skilled in the art from the disclosure herein, whereby it is to be distinctly understood that the foregoing descriptive matter is to be interpreted merely as illustrative of the invention and not as a limitation.
We Claim:
1. A system for implementing signaling mechanism in an inter process communication environment, the system comprising:
• a queue of storage buffers adapted to be concurrently accessed by a plurality of processes, said queue further adapted to receive and store inter process messages;
• a reader module adapted to generate a suspend signal and suspend accessing said queue when queue is empty, said reader module further adapted to resume accessing said queue when said queue receives at least one inter process message; and
• a writer module adapted to generate and transmit a wake up signal to said reader module after writing at least one inter process message into said queue.
2. The system as claimed in claim 1, wherein said queue contains a cyclic linked list of storage buffers.
3. The system as claimed in claim 1, wherein said system further includes a determination module adapted to determine whether said queue is empty.
4. The system as claimed in claim 1, wherein said writer module further includes a checking module adapted to check whether said reader module has suspended accessing said queue.
5. The system as claimed in claim 1, wherein said wake up signal generated and transmitted by said writer module to said reader module
is selected from the group consisting of control message and Linux futex based system call
6. The system as claimed in claim 5, wherein said control message generated and transmitted by said writer module is stored in a System V message queue.
7. The system as claimed in claim 1, wherein said reader module is adapted to suspend accessing said queue and resume accessing said queue based on whether said System V message queue is storing said control message generated and transmitted by said writer module.
8. The system as claimed in claim 1, wherein said reader module is adapted to suspend accessing said queue and resume accessing said queue, based on whether said Linux futex based system call generated and transmitted by said writer module has updated the value stored in Linux futex based variable.
9. The system as claimed in claim 1, wherein every storage buffer in said queue is linked to the next storage buffer and the last storage buffer is linked to the first storage buffer forming circular linked list for storing the messages into the storage buffers.
10.A method for signaling mechanism in a inter process communication environment, said method comprising:
• identifying a queue of storage buffers for storing inter process
messages, wherein the queue is accessed by a plurality of processes;
• determining whether the queue is empty;
• suspending accessing said queue if it is determined that the queue
is empty;
• writing at least one inter process message into said queue and
generating, transmitting a wake up signal; and
• resuming accessing said queue in response to said wake up signal.
11.The method as claimed in claim 10, wherein the step of determining whether said queue is empty includes the step of determining whether the data pointing element denoting the storage buffer containing said inter process message and free pointing element denoting a free storage buffer are pointing to the same storage buffer.
12.The method as claimed in claim 10, wherein the step of writing at least one inter process message into said queue and generating, transmitting a wake up signal further includes the step of generating and transmitting wake up signal selected from the group consisting of control message and Linux futex based system call.
13.The method as claimed in claim 10, wherein the step of resuming accessing said queue in response to said wake up signal further includes the step of resuming accessing said queue based on wake up
signal selected from the group consisting of control message and Linux futex based system call.
| Section | Controller | Decision Date |
|---|---|---|
| # | Name | Date |
|---|---|---|
| 1 | 1607-MUM-2011-CORRESPONDENCE(20-12-2012).pdf | 2012-12-20 |
| 1 | 1607-MUM-2011-PatentCertificate31-01-2023.pdf | 2023-01-31 |
| 2 | 1607-MUM-2011-PETITION UNDER RULE 137 [12-01-2023(online)].pdf | 2023-01-12 |
| 2 | abstract1.jpg | 2018-08-10 |
| 3 | 1607-MUM-2011-Written submissions and relevant documents [12-01-2023(online)].pdf | 2023-01-12 |
| 3 | 1607-mum-2011-form 3.pdf | 2018-08-10 |
| 4 | 1607-mum-2011-form 26.pdf | 2018-08-10 |
| 4 | 1607-MUM-2011-Correspondence to notify the Controller [27-12-2022(online)].pdf | 2022-12-27 |
| 5 | 1607-MUM-2011-FORM-26 [27-12-2022(online)].pdf | 2022-12-27 |
| 5 | 1607-mum-2011-form 2.pdf | 2018-08-10 |
| 6 | 1607-MUM-2011-US(14)-HearingNotice-(HearingDate-28-12-2022).pdf | 2022-11-28 |
| 6 | 1607-mum-2011-form 2(title page).pdf | 2018-08-10 |
| 7 | 1607-MUM-2011-Response to office action [31-08-2020(online)].pdf | 2020-08-31 |
| 8 | 1607-MUM-2011-FORM 1(12-4-2012).pdf | 2018-08-10 |
| 8 | 1607-MUM-2011-ABSTRACT [23-09-2019(online)].pdf | 2019-09-23 |
| 9 | 1607-MUM-2011-CLAIMS [23-09-2019(online)].pdf | 2019-09-23 |
| 9 | 1607-mum-2011-drawing.pdf | 2018-08-10 |
| 10 | 1607-mum-2011-description(complete).pdf | 2018-08-10 |
| 10 | 1607-MUM-2011-FER_SER_REPLY [23-09-2019(online)].pdf | 2019-09-23 |
| 11 | 1607-mum-2011-correspondence.pdf | 2018-08-10 |
| 11 | 1607-MUM-2011-OTHERS [23-09-2019(online)].pdf | 2019-09-23 |
| 12 | 1607-MUM-2011-CORRESPONDENCE(12-4-2012).pdf | 2018-08-10 |
| 12 | 1607-MUM-2011-FORM 3 [10-09-2019(online)].pdf | 2019-09-10 |
| 13 | 1607-mum-2011-claims.pdf | 2018-08-10 |
| 13 | 1607-MUM-2011-FER.pdf | 2019-07-24 |
| 14 | 1607-mum-2011-abstract.pdf | 2018-08-10 |
| 15 | 1607-mum-2011-claims.pdf | 2018-08-10 |
| 15 | 1607-MUM-2011-FER.pdf | 2019-07-24 |
| 16 | 1607-MUM-2011-CORRESPONDENCE(12-4-2012).pdf | 2018-08-10 |
| 16 | 1607-MUM-2011-FORM 3 [10-09-2019(online)].pdf | 2019-09-10 |
| 17 | 1607-MUM-2011-OTHERS [23-09-2019(online)].pdf | 2019-09-23 |
| 17 | 1607-mum-2011-correspondence.pdf | 2018-08-10 |
| 18 | 1607-mum-2011-description(complete).pdf | 2018-08-10 |
| 18 | 1607-MUM-2011-FER_SER_REPLY [23-09-2019(online)].pdf | 2019-09-23 |
| 19 | 1607-MUM-2011-CLAIMS [23-09-2019(online)].pdf | 2019-09-23 |
| 19 | 1607-mum-2011-drawing.pdf | 2018-08-10 |
| 20 | 1607-MUM-2011-ABSTRACT [23-09-2019(online)].pdf | 2019-09-23 |
| 20 | 1607-MUM-2011-FORM 1(12-4-2012).pdf | 2018-08-10 |
| 21 | 1607-MUM-2011-Response to office action [31-08-2020(online)].pdf | 2020-08-31 |
| 22 | 1607-mum-2011-form 2(title page).pdf | 2018-08-10 |
| 22 | 1607-MUM-2011-US(14)-HearingNotice-(HearingDate-28-12-2022).pdf | 2022-11-28 |
| 23 | 1607-mum-2011-form 2.pdf | 2018-08-10 |
| 23 | 1607-MUM-2011-FORM-26 [27-12-2022(online)].pdf | 2022-12-27 |
| 24 | 1607-MUM-2011-Correspondence to notify the Controller [27-12-2022(online)].pdf | 2022-12-27 |
| 24 | 1607-mum-2011-form 26.pdf | 2018-08-10 |
| 25 | 1607-MUM-2011-Written submissions and relevant documents [12-01-2023(online)].pdf | 2023-01-12 |
| 25 | 1607-mum-2011-form 3.pdf | 2018-08-10 |
| 26 | abstract1.jpg | 2018-08-10 |
| 26 | 1607-MUM-2011-PETITION UNDER RULE 137 [12-01-2023(online)].pdf | 2023-01-12 |
| 27 | 1607-MUM-2011-PatentCertificate31-01-2023.pdf | 2023-01-31 |
| 27 | 1607-MUM-2011-CORRESPONDENCE(20-12-2012).pdf | 2012-12-20 |
| 1 | 2019-07-2211-36-14_22-07-2019.pdf |