Method and system for regulating communication traffic using a limiter thread
First Claim
1. A method for regulating an amount of generated communication traffic using multiple execution threads or processes in a data processing system, the method comprising:
- starting a first thread or process and a second thread or process, wherein the first thread or process and the second thread or process access a message count variable in shared memory, wherein the message count variable represents a number of messages that are transmitted by the first thread or process within a first time unit;
sleeping the second thread or process for the first time unit;
in response to an awakening of the second thread or process, resetting the message count variable by the second thread or process and re-sleeping the second thread or process for the first time unit;
comparing the message count variable with a predetermined count value on the first thread or process;
in response to a first comparative result, sleeping the first thread or process for a second time unit;
in response to an awakening of the first thread or process, repeating the comparison step on the first thread or process; and
in response to a second comparative result, adjusting the message count variable and transmitting a message on the first thread or process.
1 Assignment
0 Petitions
Accused Products
Abstract
A methodology for using multiple execution threads to regulate message traffic is presented. An application thread spawns a limiter thread, and each have access in shared memory to a message count that reflects a number of messages that are transmitted by the application thread within a regulated time period. The limiter thread cycles by entering a sleep state for the regulated time period, resetting the message count upon awakening, and then reentering a sleep state. The application thread executes a loop that compares the message count against a maximum number of messages for the regulated time period; if the comparison is favorable, then another message is transmitted and the message count is adjusted. If the comparison is not favorable, then the application thread enters a sleep state; after awakening, it repeats the comparison, and depending on the result, it transmits a message or reenters a sleep state.
70 Citations
19 Claims
-
1. A method for regulating an amount of generated communication traffic using multiple execution threads or processes in a data processing system, the method comprising:
-
starting a first thread or process and a second thread or process, wherein the first thread or process and the second thread or process access a message count variable in shared memory, wherein the message count variable represents a number of messages that are transmitted by the first thread or process within a first time unit;
sleeping the second thread or process for the first time unit;
in response to an awakening of the second thread or process, resetting the message count variable by the second thread or process and re-sleeping the second thread or process for the first time unit;
comparing the message count variable with a predetermined count value on the first thread or process;
in response to a first comparative result, sleeping the first thread or process for a second time unit;
in response to an awakening of the first thread or process, repeating the comparison step on the first thread or process; and
in response to a second comparative result, adjusting the message count variable and transmitting a message on the first thread or process. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A method for regulating an amount of generated communication traffic using multiple execution threads or processes in a data processing system, the method comprising:
-
starting a first thread or process and a second thread or process, wherein the first thread or process and the second thread or process access a message count variable in shared memory;
periodically resetting the message count variable from the second thread or process;
transmitting a message from the first thread or process while the message count variable has a first comparative relationship with a threshold value;
waiting to transmit a message in the first thread or process while the message count variable has a second comparative relationship with the threshold value; and
adjusting the message count variable from the first thread or process when a message is transmitted by the first thread or process. - View Dependent Claims (7, 8)
-
-
9. A computer program product in a computer readable medium for use in regulating an amount of generated communication traffic using multiple execution threads or processes in a data processing system, the computer program product comprising:
-
instructions for starting a first thread or process and a second thread or process, wherein the first thread or process and the second thread or process access a message count variable in shared memory, wherein the message count variable represents a number of messages that are transmitted by the first thread or process within a first time unit;
instructions for sleeping the second thread or process for the first time unit;
instructions for resetting the message count variable by the second thread or process and re-sleeping the second thread or process for the first time unit in response to an awakening of the second thread or process;
instructions for comparing the message count variable with a predetermined count value on the first thread or process;
instructions for sleeping the first thread or process for a second time unit in response to a first comparative result;
instructions for repeating the comparison step on the first thread or process in response to an awakening of the first thread or process; and
instructions for adjusting the message count variable and transmitting a message on the first thread or process in response to a second comparative result. - View Dependent Claims (10, 11, 12, 13)
-
-
14. A computer program product in a computer readable medium for use in regulating an amount of generated communication traffic using multiple execution threads or processes in a data processing system, the computer program product comprising:
-
instructions for starting a first thread or process and a second thread or process, wherein the first thread or process and the second thread or process access a message count variable in shared memory;
instructions for periodically resetting the message count variable from the second thread or process;
instructions for transmitting a message from the first thread or process while the message count variable has a first comparative relationship with a threshold value;
instructions for waiting to transmit a message in the first thread or process while the message count variable has a second comparative relationship with the threshold value; and
instructions for adjusting the message count variable from the first thread or process when a message is transmitted by the first thread or process. - View Dependent Claims (15, 16)
-
-
17. An apparatus for regulating an amount of generated communication traffic using multiple execution threads or processes, the apparatus comprising:
-
means for starting a first thread or process and a second thread or process, wherein the first thread or process and the second thread or process access a message count variable in shared memory, wherein the message count variable represents a number of messages that are transmitted by the first thread or process within a first time unit;
means for comparing the message count variable with a predetermined count value on the first thread or process;
means for sleeping the first thread or process for a second time unit in response to a first comparative result;
means for repeating the comparison step on the first thread or process in response to an awakening of the first thread or process;
means for adjusting the message count variable in response to a second comparative result; and
means for transmitting a message on the first thread or process in response to a second comparative result. - View Dependent Claims (18)
-
-
19. An apparatus for regulating an amount of generated communication traffic using multiple execution threads or processes, the apparatus comprising:
-
means for starting a first thread or process and a second thread or process, wherein the first thread or process and the second thread or process access a message count variable in shared memory;
means for periodically resetting the message count variable from the second thread or process;
means for transmitting a message from the first thread or process while the message count variable has a first comparative relationship with a threshold value;
means for waiting to transmit a message in the first thread or process while the message count variable has a second comparative relationship with the threshold value; and
means for adjusting the message count variable from the first thread or process when a message is transmitted by the first thread or process.
-
Specification