Stackless Platform Independence?

Aahz Maruch aahz at panix.com
Sun Mar 3 12:51:51 EST 2002


In article <I7Qd8.66687$dG.27729291 at news1.rdc1.sdca.home.com>,
Frederic Giacometti <frederic.giacometti at arakne.com> wrote:
>
>In addition to all the benefits that Christian has described so far,
>stackless python would make it possible to have a different OS
>multi-threading implementation for calling external C/C++ libraries; one
>that does not require interpreter lock operations.
>
> [...]
>
>Stackless just means that function calls executed by the bytecode are
>executed by a C function that returns immediately; thus disconnecting
>the C call stack from the virtual machine call stack.  In current
>python, they are interleaved one-on-one; making it impossible to switch
>context within the VM unnless you do Christian's last 'non-portable'
>assembly language manipulation.

How's that again?  In the absence of pre-emptive thread scheduling, what
good is the immediate return from the C function?  More than that, how
can you possibly call external libraries without the interpreter lock,
if those libraries have any access to Python variables?  If they *don't*
have access to Python, how is that any different from just using the
macros Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS?
-- 
                      --- 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