Check out my first novel, midnight's simulacra!

Bip buffers

From dankwiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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.