The following piece of pseudo-code shows a typical reader / writer scenario:
string document; string::size_type length = 0; write() { while (true) {