Here are versions of my earlier yield-from examples that have been modified to use cofunctions instead. Mostly the changes consist of deleting 'yield from' and adding 'codef' where necessary. In the scheduler, I incorporated a yield into the block() function, so that instead of block(queue) yield you now just write block(queue) I have also added a coschedule() function that calls costart() on the supplied function and schedules it.