Check out my first novel, midnight's simulacra!

Bip buffers

From dankwiki
Revision as of 17:15, 9 July 2009 by Dank (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.