Bip buffers

From dankwiki
Jump to navigation Jump to search

A variant of circular buffer, popularized by Simon Cooke on the CodeProject. The "bip" stands for "bipartite".

I've improved Cooke's bip buffers for the case where the buffer must be able to dynamically grow (ie, due to irregular TCP patterns), using Linux's mremap_file_pages(2)/mremap(2) or, on other operating systems, mmap(MAP_FIXED) to effect accordion buffering using a single underlying circlebuffer that's just as fast (and more resource-efficient) as a multiple buffer solution.