re the earlier thread: http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html Something along those lines is probably the best way to do it. Data processing libraries ought to be written this way -- zlib, libbz2 and librsync are. -- Martin