Patent ID: 11960933
Assignee: RED HAT, INC.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 0:
1. A method comprising:
receiving, by a producer thread of a plurality of producer threads, an offer request associated with an item;
responsive to receiving the offer request, increasing arithmetically, by the producer thread, a sequence according to a fetch-and-add instruction;
determining, by the producer thread, (i) a chunk identifier, associated with the sequence, of a memory chunk from a pool of memory chunks and (ii) a first slot position, from the sequence, in the memory chunk to offer the item, wherein the sequence contains values corresponding with slot positions and the first slot position is a next slot position in the sequence which corresponds to a second slot within the memory chunk;
comparing the chunk identifier with a current producer memory chunk;
walking the current producer memory chunk backwards to match the chunk identifier;
writing, by the producer thread, the item into the memory chunk at the first slot position;
determining, by a first consumer thread of a plurality of consumer threads, the first slot position of the item;
consuming, by the first consumer thread, the item at the first slot position;
consuming, by a second consumer thread of the plurality of consumer threads, another item at a second slot position in the memory chunk;
determining, by the second consumer thread referring to a consumer buffer coordinating the plurality of consumer threads, that the memory chunk is recyclable; and
recycling, by the second consumer thread, the memory chunk.