Hi, I just created coroutine support for Ruby. Coroutines allow blocks to run concurrently while you control when the context is switched between them. Say you want to execute two blocks, like this: block1 block2 block1.start *** block1 runs --------------> block1.switch(block2) *** block2 runs <-------------- block2.switch(block1) *** block1 runs --------------> block1.switch(block2) *** block2 runs The difference between coroutines and thread is that with coroutines, the context switch occures when the block requests it, not preemptively by a scheduler. Coroutines is great when the two blocks share the same values because the use of semaphores is errorprone (it's sometimes hard to avoid race conditions) and adds a significant overhead (because the semaphores need to be checked and updated). You can find the code (with an example included) on http://nanoxml.sourceforge.net/coroutines.rb The code is presented under an open source license (libpng/zlib) so feel free to use it in your projects. --Marc Marc.DeScheemaecker / advalvas.be