×

Re-use of invalidated data in buffers

  • US 9,898,398 B2
  • Filed: 12/30/2013
  • Issued: 02/20/2018
  • Est. Priority Date: 12/30/2013
  • Status: Active Grant
First Claim
Patent Images

1. In a computing environment, a method of reusing data stored in a ring buffer in memory, the method comprising:

  • accessing data in a first portion of the ring buffer in the memory, the ring buffer in the memory comprising a first pointer that points to a location where a free portion of the ring buffer in the memory begins, and a second pointer that points to a location where the free portion of the ring buffer in the memory ends;

    invalidating the data in the first portion of the ring buffer in the memory by marking the first portion of the ring buffer in the memory as free, but where the data in the first portion of the ring buffer in the memory is not yet overwritten, wherein invalidating the data in the first portion of the ring buffer in the memory by marking the first portion of the ring buffer in the memory as free comprises moving the second pointer past the first portion of the ring buffer in the memory to include the first portion of the ring buffer in the memory in the free portion of the ring buffer in the memory;

    determining to reuse a portion of the data in the first portion of the ring buffer in the memory for an operation after the data in the first portion of the ring buffer in the memory has been invalidated by the first portion of the ring buffer in the memory being marked as free;

    determining, based on the position of the first portion of the ring buffer in the memory in the free portion of the ring buffer in the memory, including a determination of how much of the data in the first portion of the ring buffer in the memory will be used for the operation and will be revalidated by moving the second pointer to include the first portion of the ring buffer in the memory to an active valid portion of the ring buffer in the memory compared to how much data in the free portion of the ring buffer in memory will not be used for the operation but will be revalidated by moving the second pointer, an action to perform; and

    performing the determined action, wherein the determined action is selected from the group comprising;

    moving the second pointer to revalidate the data in the first portion of the ring buffer in the memory to include the first portion of the ring buffer in the memory in the active valid portion of the ring buffer in the memory, if the portion of the data in the first portion of the ring buffer in the memory that is used for the operation meets a threshold with respect to the data in the free portion of the ring buffer in memory that would be revalidated but not used for the operation by moving the second pointer; and

    copying the portion of the data in the first portion of the ring buffer in the memory that is used for the operation, re-writing the portion of the data in the first portion of the ring buffer in the memory that is used for the operation to the ring buffer in the memory, and moving the first pointer in the ring buffer in the memory to include the re-written data in the active valid portion of the ring buffer in the memory, if the portion of the data in the first portion of the ring buffer in the memory that is used for the operation does not meet the threshold with respect to the data in the free portion of the ring buffer in memory that would be revalidated but not used for the operation by moving the second pointer.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×