Wait-free algorithm for inter-core, inter-process, or inter-task communication
AssigneeBarco N.V.
InventorPeter Mortier
Life of this patent
Estimating the term…
Abstract
A method and system are presented for providing deterministic inter-core, inter-process, and inter-thread communication between a reader and a writer. The reader and writer communicate by passing data through a shared memory using double buffering of double buffers. The shared memory includes a first double buffer and a second double buffer. Both double buffers include a first low level buffer and a second low level buffer. Using double buffering of the double buffers, both the reader and the writer may simultaneously access the shared memory.
Claims22
A method for providing deterministic inter-core, inter-process, and inter-thread communication between a reader and a writer by passing data through shared memory using double buffering of double buffers, the method comprising:
- the reader or writer selecting one of a first double buffer or a second double buffer as a selected double buffer, wherein the writer writes data to the selected double buffer, each double buffer is stored in the shared memory, and each double buffer comprises a first low level buffer and a second low level buffer;
- the reader reading data, wherein reading data comprises:
- the reader determining if new data has been written to the selected double buffer, wherein new data corresponds to data that has not been read by the reader;
- if new data has been written to the selected double buffer:
- the reader selecting the non-selected double buffer as the selected double buffer such that the writer writes data to the newly selected double buffer;
- the reader determining if new data has been written to the previously selected double buffer in the time since the previous check to determine if new data had been written to the previously selected double buffer;
- the reader accessing and outputting the last data written to the previously selected double buffer;
- if new data has not been written to the selected double buffer:
- the reader determining if old data or new data was written to the non-selected double buffer, wherein old data corresponds to data that the reader has previously read;
- if neither old data nor new data was written to the non-selected double buffer, no data is output by the reader;
- and
- if old data or new data was written to the non-selected double buffer, the reader accessing and outputting the last data written to the non-selected double buffer.
Dependencies are inferred from the claim text.