Stackless Platform Independence?

Christian Tismer tismer at tismer.com
Tue Mar 5 06:29:36 EST 2002


Just van Rossum wrote:

> 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.


I was wrong: I did understand Frederic's, but was too
quick with Paul's. :-)

> 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.


I agree mostly. In the last sentence, I don't understand
how working with windows files can be something different
than an I/O problem?.

Both approaches make sense to me. On systems with no threads
at all, we have only one choice, Paul's, unless we code
something thread-alike for the specific platform.
When real threads are available, the other is more powerful.

BTW., your Mac OsX Power PC Stackless is in CVS.

cheers - chris

-- 
Christian Tismer             :^)   <mailto:tismer at tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net/
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
      where do you want to jump today?   http://www.stackless.com/






More information about the Python-list mailing list