Invention Grant
- Patent Title: Mechanism for a lockless ring buffer in overwrite mode
- Patent Title (中): 覆盖模式下无锁环形缓冲区的机制
-
Application No.: US12481397Application Date: 2009-06-09
-
Publication No.: US08099546B2Publication Date: 2012-01-17
- Inventor: Steven D. Rostedt
- Applicant: Steven D. Rostedt
- Applicant Address: US NC Raleigh
- Assignee: Red Hat, Inc.
- Current Assignee: Red Hat, Inc.
- Current Assignee Address: US NC Raleigh
- Agency: Lowenstein Sandler PC
- Main IPC: G06F12/00
- IPC: G06F12/00

Abstract:
In one embodiment, a mechanism for a lockless ring buffer in overwrite mode is disclosed. In one embodiment, a method for implementing a lockless ring buffer in overwrite mode includes aligning memory addresses for each page of a ring buffer to form maskable bits in the address to be used as a state flag for the page and utilizing at least a two least significant bits of each of the addresses to represent the state flag associated with the page represented by the address, wherein the state flag indicates one of three states including a header state, an update state, and a normal state. The method further includes combining a movement of a head page pointer to a head page of the ring buffer with a swapping of the head page and a reader page, the combining comprising updating the state flag of the head page pointer to the normal state and updating the state flag of a pointer to the page after the head page to the header state, and moving the head page and a tail page of the ring buffer, the moving comprising updating the state flags of one or more pointers in the ring buffer associated with the head page and the tail page.
Public/Granted literature
- US20100312985A1 Mechanism for a Lockless Ring Buffer in Overwrite Mode Public/Granted day:2010-12-09
Information query