Index: ossp-pkg/sio/BRAINSTORM.txt RCS File: /v/ossp/cvs/ossp-pkg/sio/BRAINSTORM.txt,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/sio/BRAINSTORM.txt,v' 2>/dev/null --- BRAINSTORM.txt 2002/10/07 13:49:31 1.1 +++ BRAINSTORM.txt 2002/10/14 08:05:49 1.2 @@ -302,3 +302,64 @@ int sio_pop (sio_t *sio); int sio_swap (sio_t *sio1, sio_t *sio2); +########################################################################### + +mlelstv sez: + +sio pipe: +- two chains of handlers for reading and writing +- "bucket brigade"-buffers, degenerates to static buffer(ptr,len) +- handler degenerates to (handle,read(2),write(2)) ? + +dispatching: +- sio_strategy(chain) + h = chain; + while (h) { + if h->call(sio) // reader or writer + h = h->next; + else + h = h->prev; + } + +? eof/error propagation -> global flags, (byte offset ?) + +- sio_write(buf) + push sio->writebuffer, buf; + sio_strategy(sio->writers); + buf = pop sio->writebuffer; + +- sio_read(bound) + sio->readbuffer->append(buf); + sio_strategy(sio->readers); + pop sio->readbuffer; + + +buffer: +- bytestream(policy for chunks ?) +- drop bytestream +- append bytes to bytestream (ptr, len) == copy +- prepend bytes to bytestream (ptr, len) == copy +- append static buffer to bytestream +- splice bytestream into new bytestream (offset, length, dest) +- truncate bytestream (offset, length) == splice but drop data +- traverse chunks of bytestream forward (offset, length) +- traverse chunks of bytestream reverse (offset, length) +- splice last chunk from bytestream (convenience function) +- splice first chunk from bytestream (convenience function) +- flatten chunks of bytestream into target buffer (convenience function) +- garbage collection ? pullup ? seek cache ? +- read consistency while traversing ? + +bytestream, chunks, buffer + +chunk memory allocator needed +buffer memory allocator ? + +--- + +stdio "emulation" + +fixed buffer <-> bytestream +EOF handling + +