# US 2008/0307431 A1 · Automatic adjustment of time a consumer waits to access data from queue during a waiting phase and transmission phase at the queue

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0307431 A1
- Document ID: US20080307431A1
- Status: Published application
- Kind: A1
- Application number: 12/193,473
- Filed: 2008-08-18
- Published: 2008-12-11
- Earliest claimed: 2005-02-24
- Assignees: International Business Machines Corporation
- Inventors: Hai-Yann Hwang
- Web page: https://patentgrep.com/patent/US20080307431A1

## CPC

- G06F 9/546: {Message passing systems or structures, e.g. queues}
- G06F 9/52: Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F 2209/548: Queue
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided are a system and article of manufacture for automatic adjustment of time a consumer waits to access data from a queue during a waiting phase and transmission phase at the queue. A determination is made as to whether a queue is in a waiting phase or a transmission phase for data in response to waiting for a waiting phase wait time when initiating an operation to access data from the queue. During the waiting phase data is not available in the queue for reading. An incremental wait time is waited in response to determining that the queue is in the waiting phase. A determination is made as to whether the queue is in the waiting phase or the transmission phase in response to waiting the incremental wait time. A total wait time is recorded in response to determining that the queue is in the transmission phase. The at least one recorded total wait time is used to determine the waiting phase wait time to use when initiating the operation to access data from the queue.

## Claims

### Claim 1

An article of manufacture comprising a computer readable storage medium including code executed by a processor to communicate with a memory and request data from a queue, wherein code causes operations to be performed, the operations comprising:
determining whether the queue is in a waiting phase or a transmission phase for data in response to waiting for a waiting phase wait time when initiating an operation to access data from the queue, wherein during the waiting phase data is not available in the queue for reading;
waiting an incremental wait time in response to determining that the queue is in the waiting phase;
determining whether the queue is in the waiting phase or the transmission phase in response to waiting the incremental wait time;
recording a total wait time in the memory in response to determining that the queue is in the transmission phase; and
using the at least one recorded total wait time to determine the waiting phase wait time to use when initiating the operation to access data from the queue.

### Claim 2 (depends on 1)

The article of manufacture of claim 1, further comprising:
performing an additional iteration of waiting the incremental wait time and determining whether the queue is in the waiting phase or transmission phase in response to determining that the queue is in the waiting phase after waiting the incremental wait time.

### Claim 3 (depends on 1)

The article of manufacture of claim 1, wherein determining the waiting phase wait time to use comprises:
determining a percentage of an average of a plurality of recorded total wait times.

### Claim 4

The article of manufacture of 3, further comprising:
determining the incremental wait time that is used as a percentage of the determined waiting phase wait time.

### Claim 5 (depends on 1)

The article of manufacture of claim 1, further comprising:
reading data from the queue in response to determining that the queue is in the transmission phase;
recording an amount of data read in the memory; and
reading data from the queue in response to waiting a transmission wait time.

### Claim 6 (depends on 5)

The article of manufacture of claim 5, wherein one recorded amount of data read comprises an amount of data read divided by a previously used transmission wait time, further comprising:
determining the transmission wait time to use based on recorded amounts of data read.

### Claim 7 (depends on 6)

The article of manufacture of claim 6, wherein determining the transmission wait time to use comprises:
increasing a previously used transmission wait time in response to determining that the recorded amounts of data read are decreasing.

### Claim 8 (depends on 6)

The article of manufacture of claim 6, wherein determining the transmission wait time to use comprises:
decreasing a previously used transmission wait time in response to determining that the recorded amounts of data remain substantially unchanged.

### Claim 9 (depends on 6)

The article of manufacture of claim 6, wherein the transmission wait time to use comprises a previously used transmission rate time in response to determining that the recorded amounts of data read are increasing.

### Claim 10 (depends on 1)

The article of manufacture of claim 1, wherein the article of manufacture is in communication with a plurality of producers managing a plurality of queues, and wherein separate recorded wait times are gathered and maintained in the memory for each producer and are used to determine the wait phase wait time to access the at least one queue managed by each producer.

### Claim 11

A system, comprising:
a memory;
a producer managing a queue in the memory;
a consumer in communication with the queue and the memory;
a computer readable medium including code executed by the consumer to perform operations, the operations comprising:
determining whether the queue is in a waiting phase or a transmission phase for data in response to waiting for a waiting phase wait time when initiating an operation to access data from the queue, wherein during the waiting phase data is not available in the queue for reading;
waiting an incremental wait time in response to determining that the queue is in the waiting phase;
determining whether the queue is in the waiting phase or the transmission phase in response to waiting the incremental wait time;
recording a total wait time in the memory in response to determining that the queue is in the transmission phase; and
using the at least one recorded total wait time to determine the waiting phase wait time to use when initiating the operation to access data from the queue.

### Claim 12 (depends on 11)

The system of claim 11, wherein the operations further comprise:
performing an additional iteration of waiting the incremental wait time and determining whether the queue is in the waiting phase or transmission phase in response to determining that the queue is in the waiting phase after waiting the incremental wait time.

### Claim 13 (depends on 11)

The system of claim 11, wherein determining the waiting phase wait time to use comprises:
determining a percentage of an average of a plurality of recorded total wait times.

### Claim 14 (depends on 13)

The system of claim 13, wherein the operations further comprise:
determining the incremental wait time that is used as a percentage of the determined waiting phase wait time.

### Claim 15 (depends on 11)

The system of claim 11, wherein the operations further comprise:
reading data from the queue in response to determining that the queue is in the transmission phase;
recording an amount of data read in the memory; and
reading data from the queue in response to waiting a transmission wait time.

### Claim 16 (depends on 15)

The system of claim 15, wherein one recorded amount of data read comprises an amount of data read divided by a previously used transmission wait time, and wherein the operations further comprise:
determining the transmission wait time to use based on recorded amounts of data read.

### Claim 17 (depends on 16)

The system of claim 16, wherein determining the transmission wait time to use comprises:
increasing a previously used transmission wait time in response to determining that the recorded amounts of data read are decreasing.

### Claim 18 (depends on 16)

The system of claim 16, wherein determining the transmission wait time to use comprises:
decreasing a previously used transmission wait time in response to determining that the recorded amounts of data remain substantially unchanged.

### Claim 19 (depends on 16)

The system of claim 16, wherein the transmission wait time to use comprises a previously used transmission rate time in response to determining that the recorded amounts of data read are increasing.

### Claim 20

A system, comprising:
a memory;
a plurality of producers, each managing at least one queue in the memory;
at least one consumer in communication with the queues and the memory;
a computer readable medium including code executed by at least one consumer to perform operations with respect to queues managed by different producers, the operations comprising:
determining whether one queue is in a waiting phase or a transmission phase for data in response to waiting for a waiting phase wait time when initiating an operation to access data from the queue, wherein during the waiting phase data is not available in the queue for reading;
waiting an incremental wait time in response to determining that the queue is in the waiting phase;
determining whether the queue is in the waiting phase or the transmission phase in response to waiting the incremental wait time;
recording a total wait time in the memory in response to determining that the queue is in the transmission phase, wherein separate recorded wait times are gathered and maintained in the memory for different producers; and
using the at least one recorded total wait time to determine the waiting phase wait time to use when initiating the operation to access data from the queue, wherein the recorded total wait times for different producers are used to determine the wait phase wait time for the different producers.

### Claim 21

A system, comprising:
a memory;
means for determining whether the queue is in a waiting phase or a transmission phase for data in response to waiting for a waiting phase wait time when initiating an operation to access data from the queue, wherein during the waiting phase data is not available in the queue for reading;
means for waiting an incremental wait time in response to determining that the queue is in the waiting phase;
means for determining whether the queue is in the waiting phase or the transmission phase in response to waiting the incremental wait time;
means for recording a total wait time in the memory in response to determining that the queue is in the transmission phase; and
means for using the at least one recorded total wait time to determine the waiting phase wait time to use when initiating the operation to access data from the queue.
