Stackless Platform Independence?

Aahz Maruch aahz at panix.com
Mon Mar 4 12:09:21 EST 2002


[Frederic, please make sure to keep attributions, even for your own
quotes.  This makes it easier to hold discussion among multiple people.]

In article <3C838150.97A86F52 at arakne.com>,
Frederic Giacometti  <frederic.giacometti at arakne.com> wrote:
>Aahz Maruch wrote:
>>Frederic:
>>>
>>>Just reverse the paradigm: have the python VM run in a single thread,
>>>using stackless microthreads for python multithreading, and run the C
>>>calls in a pool of threads.  This way: no lock is needed, since only
>>>one thread runs the VM, with the help of microthreads, and C calls run
>>>in other threads.
>>
>> This doesn't make any sense unless you assume OS-level threads, and I
>> thought part of the point of Stackless was to avoid requiring OS-level
>> threads.
>
>More precisely, the point of stackless is to dispense from OS threads
>(and Python lock) overheads for running threaded Python bytecode.
>However, OS threads are still required to take charge of calls to
>blocking C function (usually from external C libraries) that one want
>to run asynchronously to the PVM; there is no turn around to this.

Sure there is: just use Python's standard threading capabilities and
release the Global Interpreter Lock, just like you do now.  I will grant
that it's not the most convenient thing in the world, and maybe we'll
want to fix this in the future, but I think that getting Stackless done
and squared away is more important than resolving this in the cleanest
possible fasion.

practicality-beats-purity-ly y'rs
-- 
                      --- Aahz  <*>  (Copyright 2002 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista

"How come we choose from just two people for President but more than 50
for Miss America?"  --AEN



More information about the Python-list mailing list