IP Library Granted Patent US 12,045,655
Granted Patent B2
US 12,045,655 · App. 17/325,534 · Granted Jul 23, 2024

Assisting progressive chunking for a data queue by using a consumer thread of a processing device

Inventors: Daniele Zonca (Vignate, IT); Francesco Nigro (Gorgonzola, IT)
Assignee: RED HAT, INC.
G06F9/5016G06F9/466
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,045,655
App. No.
17/325,534
Granted
Jul 23, 2024
Kind
B2
Abstract

Consumer threads can assist in performing progressive chunking for a data queue. For example, a consumer thread can determine a current-chunk identifier indicating a current memory chunk of an unbounded queue, where the current memory chunk is associated with a producer thread that is different from the consumer thread. The consumer thread can determine a target-chunk identifier indicating a target memory chunk to which the producer thread is to write a data item. In response to determining that the target-chunk identifier is greater than the current-chunk identifier, the consumer thread can append a new memory chunk to the unbounded queue for use as the target memory chunk by the producer thread.

Claims (52)

1. A processing device comprising;

a producer thread for writing data items to an unbounded queue stored in a memory, wherein the unbounded queue includes a set of memory chunks, the producer thread being configured to:

receive a write request for writing a particular data item to the unbounded queue; and

update a producer sequence-value stored in the memory to a value representing the write request;

update a producer buffer-value stored in the memory to indicate a current write location in the unbounded queue for the producer thread;

a consumer thread that is different from the producer thread, the consumer thread being for reading the data items from the unbounded queue stored in the memory, the consumer thread being configured to:

retrieve the producer buffer-value from the memory;

determine a current-chunk identifier based on the producer buffer-value, wherein the current-chunk identifier identifies the current write location for the producer thread in the unbounded queue, wherein the current-chunk identifier is a first numerical value, and the current write location is a particular memory chunk of the set of memory chunks;

retrieve the producer sequence-value from the memory;

determine a target-chunk identifier based on the producer sequence-value, wherein the target-chunk identifier identifies a target write location to which the producer thread is to write the particular data item, wherein the target-chunk identifier is a second numerical value, the target write location is different than the current write location, and the target write location corresponds to a target memory chunk;

compare the target-chunk identifier to the current-chunk identifier; and

in response to determining that the target-chunk identifier is greater than the current-chunk identifier, append a memory chunk to an end of the unbounded queue, wherein the producer thread writes the particular data item to the memory chunk after the memory chunk is appended to the unbounded queue.

2. The processing device of claim 1 , wherein the producer thread is configured to update the producer sequence-value in response to write requests.

3. The processing device of claim 2 , wherein the consumer thread is configured to determine the target-chunk identifier by dividing the producer sequence-value by a number of slots in the target memory chunk.

4. The processing device of claim 1 , wherein the memory chunk is a reused memory chunk from a pool of memory chunks previously assigned to the unbounded queue.

5. The processing device of claim 1 , wherein the consumer thread is configured to append the memory chunk to the unbounded queue by appending the memory chunk to the particular memory chunk.

6. The processing device of claim 1 , wherein the producer buffer-value is a pointer to the current write location.

7. The processing device of claim 1 , wherein the producer thread is a first producer thread, and further comprising a second producer thread configured to write data items to the unbounded queue.

8. The processing device of claim 1 , wherein the consumer thread is configured to add the memory chunk to the unbounded queue subsequent to the producer thread receiving the write request and prior to the particular data item being written to the memory.

9. A method comprising:

receiving, by a producer thread of a processing device, a write request for writing a data item to an unbounded queue stored in a memory, wherein the unbounded queue includes a set of memory chunks;

updating, by the producer thread, a producer sequence-value stored in the memory to a value representing the write request;

updating, by the producer thread, a producer buffer-value stored in the memory to indicate a current write location in the unbounded queue for the producer thread;

retrieving, by a consumer thread of the processing device, the producer buffer-value from the memory, wherein the consumer thread is different from the producer thread;

determining, by the consumer thread, a current-chunk identifier based on the producer buffer-value, wherein the current-chunk identifier identifies the current write location for the producer thread in the unbounded queue, wherein the current-chunk identifier is a first numerical value, and the current write location is a particular memory chunk of the set of memory chunks;

retrieving, by the consumer thread, the producer sequence-value from the memory;

determining, by the consumer thread, a target-chunk identifier based on the producer sequence-value, wherein the target-chunk identifier identifies a target write location to which the producer thread is to write the data item, wherein the target-chunk identifier is a second numerical value, the target write location is different than the current write location, and the target write location corresponds to a target memory chunk;

comparing, by the consumer thread, the target-chunk identifier to the current-chunk identifier; and

in response to determining that the target-chunk identifier is greater than the current-chunk identifier, appending, by the consumer thread, a memory chunk to an end of the unbounded queue, wherein the producer thread writes the data item to the memory chunk after the memory chunk is appended to the unbounded queue.

10. The method of claim 9 , wherein the producer sequence-value associated with the producer thread is a counter value, and wherein updating the producer sequence-value involves incrementing the counter value.

11. The method of claim 9 , further comprising:

determining, by the consumer thread, the target-chunk identifier by dividing the producer sequence-value by a number of slots per memory chunk of the unbounded queue.

12. The method of claim 9 , wherein the memory chunk is a reused memory chunk from a pool of memory chunks previously assigned to the unbounded queue.

13. The method of claim 9 , wherein appending the memory chunk to the unbounded queue involves appending the memory chunk to the particular memory chunk.

14. The method of claim 9 , wherein the consumer thread appends the memory chunk to the unbounded queue subsequent to the producer thread receiving the write request and prior to the data item being written to the memory.

15. A non-transitory computer-readable medium comprising program code that is executable by a processing device for causing the processing device to perform operations including:

receiving, by a producer thread of the processing device, a write request for writing a data item to an unbounded queue stored in a memory, wherein the unbounded queue includes a set of memory chunks;

updating, by the producer thread, a producer sequence-value stored in the memory to a value representing the write request;

updating, by the producer thread, a producer buffer-value stored in the memory to indicate a current write location in the unbounded queue for the producer thread;

retrieving, by a consumer thread of the processing device, the producer buffer-value from the memory, wherein the consumer thread is different from the producer thread;

determining, by the consumer thread, a current-chunk identifier based on the producer buffer-value, wherein the current-chunk identifier identifies the current write location for the producer thread in the unbounded queue, wherein the current-chunk identifier is a first numerical value, and the current write location is a particular memory chunk of the set of memory chunks;

retrieving, by the consumer thread, the producer sequence-value from the memory;

determining, by the consumer thread, a target-chunk identifier based on the producer sequence-value, wherein the target-chunk identifier identifies a target write location to which the producer thread is to write the data item, wherein the target-chunk identifier is a second numerical value, the target write location is different than the current write location, and the target write location corresponds to a target memory chunk;

comparing, by the consumer thread, the target-chunk identifier to the current-chunk identifier;

in response to determining that the target-chunk identifier is greater than the current-chunk identifier, appending, by the consumer thread, a memory chunk to an end of the unbounded queue; and

writing, by the producer thread, the data item to the memory chunk after the memory chunk is appended to the unbounded queue.

16. The non-transitory computer-readable medium of claim 15 , wherein the memory chunk is a reused memory chunk from a pool of memory chunks previously assigned to the unbounded queue.

17. The non-transitory computer-readable medium of claim 15 , wherein the operations further comprise:

determining, by the consumer thread, the target-chunk identifier by dividing the producer sequence-value by a number of slots per memory chunk of the unbounded queue.

18. The non-transitory computer-readable medium of claim 15 , wherein appending the memory chunk to the unbounded queue involves appending the memory chunk to the current write location.

19. The non-transitory computer-readable medium of claim 15 , wherein the operations involve:

appending, by the consumer thread, the memory chunk to the unbounded queue subsequent to the producer thread receiving the write request and prior to the data item being written to the memory.

Assignments (2)
CHANGE OF NAME Recorded Mar 3, 2026
From: RED HAT, INC.
To: RED HAT, LLC
Reel/Frame 074913/0759 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 3, 2024
From: ZONCA, DANIELE; NIGRO, FRANCESCO
To: RED HAT, INC.
Reel/Frame 067311/0569 →