DUAL-BUFFER SERIALIZATION AND CONSUMPTION OF VARIABLE-LENGTH DATA RECORDS PRODUCED BY MULTIPLE PARALLEL THREADS
First Claim
1. A method, comprising:
- under control of a consumer;
determining, with a processor of a computer, that a first buffer is empty and that a second buffer contains data, wherein the first buffer has a double-pointer, and wherein the second buffer has a double pointer;
executing a first compare-double-and-swap operation within a spin loop, wherein the executing includes swapping the double pointer of the first buffer and the double pointer of the second buffer, wherein responsive to the executing of the operation the consumer drains the second buffer, and wherein the executing of the operation directs at least one producer to fill the first buffer; and
determining that the first buffer and the second buffer are empty and responsively waiting for a notification from one of i) the at least one producer and ii) a timer; and
under control of the at least one producer;
executing a second compare-double-and-swap operation within a spin loop, wherein executing the second compare-double-and-swap operation includes atomically locating the first buffer and updating the double pointer of the first buffer to reserve a slot for a data record in the first buffer.
1 Assignment
0 Petitions
Accused Products
Abstract
Under control of the consumer, it is determined that a first buffer is empty and that a second buffer contains data; a first compare-double-and-swap operation within a spin loop is executed to swap a double pointer of the first buffer and a double pointer of the second buffer, wherein responsive to the executing of the operation the consumer drains the second buffer, and wherein the executing of the operation directs the at least one producer to fill the first buffer; and it is determined that the first buffer and the second buffer are empty and the consumer waits for a notification from one of i) the at least one producer and ii) a timer. Under control of the at least one producer, a second compare-double-and-swap operation within a spin loop is executed to atomically locate the first buffer and update the double pointer of the first buffer.
-
Citations
21 Claims
-
1. A method, comprising:
-
under control of a consumer; determining, with a processor of a computer, that a first buffer is empty and that a second buffer contains data, wherein the first buffer has a double-pointer, and wherein the second buffer has a double pointer; executing a first compare-double-and-swap operation within a spin loop, wherein the executing includes swapping the double pointer of the first buffer and the double pointer of the second buffer, wherein responsive to the executing of the operation the consumer drains the second buffer, and wherein the executing of the operation directs at least one producer to fill the first buffer; and determining that the first buffer and the second buffer are empty and responsively waiting for a notification from one of i) the at least one producer and ii) a timer; and under control of the at least one producer; executing a second compare-double-and-swap operation within a spin loop, wherein executing the second compare-double-and-swap operation includes atomically locating the first buffer and updating the double pointer of the first buffer to reserve a slot for a data record in the first buffer. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer program product, the computer program product comprising:
-
a computer readable storage medium having computer readable program code embodied therein, the computer readable program code, when executed by a processor of a computer, is configured to perform; under control of a consumer; determining, with a processor of a computer, that a first buffer is empty and that a second buffer contains data, wherein the first buffer has a double-pointer, and wherein the second buffer has a double pointer; executing a first compare-double-and-swap operation within a spin loop, wherein the executing includes swapping the double pointer of the first buffer and the double pointer of the second buffer, wherein responsive to the executing of the operation the consumer drains the second buffer, and wherein the executing of the operation directs at least one producer to fill the first buffer; and determining that the first buffer and the second buffer are empty and responsively waiting for a notification from one of i) the at least one producer and ii) a timer; and under control of the at least one producer; executing a second compare-double-and-swap operation within a spin loop, wherein executing the second compare-double-and-swap operation includes atomically locating the first buffer and updating the double pointer of the first buffer to reserve a slot for a data record in the first buffer. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A computer system, comprising:
-
a processor; and a storage device coupled to the processor, wherein the storage device has stored thereon a program, and wherein the processor is configured to execute instructions of the program to perform operations, wherein the operations comprise; under control of a consumer; determining, with a processor of a computer, that a first buffer is empty and that a second buffer contains data, wherein the first buffer has a double-pointer, and wherein the second buffer has a double pointer; executing a first compare-double-and-swap operation within a spin loop, wherein the executing includes swapping the double pointer of the first buffer and the double pointer of the second buffer, wherein responsive to the executing of the operation the consumer drains the second buffer, and wherein the executing of the operation directs at least one producer to fill the first buffer; and determining that the first buffer and the second buffer are empty and responsively waiting for a notification from one of i) the at least one producer and ii) a timer; and under control of the at least one producer; executing a second compare-double-and-swap operation within a spin loop, wherein executing the second compare-double-and-swap operation includes atomically locating the first buffer and updating the double pointer of the first buffer to reserve a slot for a data record in the first buffer. - View Dependent Claims (16, 17, 18, 19, 20, 21)
-
Specification