Stackless Platform Independence?
Just van Rossum
just at xs4all.nl
Tue Mar 5 06:05:42 EST 2002
In article <mailman.1015320430.17383.python-list at python.org>,
Christian Tismer <tismer at tismer.com> wrote:
> Paul Rubin wrote:
>
> > Do you think it's feasible to modify Python to use non-blocking i/o
> > everywhere, and then simulate blocking in Stackless? I.e. when a
> > microthread does an i/o operation, Python would start the operation
> > asynchronously, and the Stackless microthread scheduler would block
> > the microthread til the i/o operation actually completes (detected
> > using select or SIGIO).
>
>
> This is roughly how I understood Frederic's idea.
This is not at all how I understood Frederic's idea... I thought his
idea was about using os threads for C calls (such as I/O), so you could
simply use blocking sockets as they will be run in an OS thread. With
non-blocking sockets you can indeed get a long way avoiding OS threads
completely, while still presenting a blocking interface, which is what
Paul means. It's not a complete solution, though, eg on windows file
system files don't work with select and you haven't solved the problem
of microthreads blocking when calling a C extension. And _that's_ the
area where Frederic's idea would shine, not so much I/O.
Just
More information about the Python-list
mailing list