×

DUAL-BUFFER SERIALIZATION AND CONSUMPTION OF VARIABLE-LENGTH DATA RECORDS PRODUCED BY MULTIPLE PARALLEL THREADS

  • US 20140237145A1
  • Filed: 02/20/2013
  • Published: 08/21/2014
  • Est. Priority Date: 02/20/2013
  • Status: Active Grant
First Claim
Patent Images

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 all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×