Hi,

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:
   try:
     return os.read(fd, size)
   except OSError, e:
     if errno != errno.EAGAIN:
       raise
     my_event_loop.add_read(fd)
     stackless.schedule_remove()
     # The event loop tasklet will schedule us once there is data
     # to read from fd.

Thanks,

Péter

_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless

Reply via email to