[Stackless] Stackless and Pyrex efficiently

Péter Szabó ptspts+stackless at gmail.com
Mon Jan 25 22:26:43 CET 2010


I'm planning to reimplement some of my Stackless I/O buffering +
read(2) + write(2) code in Pyrex. Is it possible to call
stackless.schedule_remove() from a Pyrex method (or a C extension
function)? Is it recommended? How should I make it work most
efficiently? Is there a recommended alternative?

I'd like to translate a function like this to Pyrex:

def Read(fd, size):
 while True:
     return os.read(fd, size)
   except OSError, e:
     if errno != errno.EAGAIN:
     # The event loop tasklet will schedule us once there is data
     # to read from fd.



More information about the Stackless mailing list