>allocated, written and read positions

That doesn't really explain anything. allocated = break? The part between read and written has to be consumed? Why do we need apos?