Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > I am not really familiar with ruby but these fibers seem to be some > sort of coroutines. Since python 2.5, generators can be sent values, > this can be used to implement what you want. I have had a got at it > for fun and this is what I came up with: note that there is no need > for a specific class, or for threads. I have tested this only on your > example, but it gives the same result as your code :)
I think it was Microsoft who invented the term 'fiber' as a synonym for coroutine. See http://msdn2.microsoft.com/en-us/library/ms682661.aspx Unfortunately generators only save a single level of stack-frame, so they are not really a replacement for fibers/coroutines. The OP should perhaps look at Stackless Python or Greenlets. See http://codespeak.net/py/dist/greenlet.html -- http://mail.python.org/mailman/listinfo/python-list