Stackless/microthreads merge news

Konrad Hinsen hinsen at cnrs-orleans.fr
Mon Mar 13 08:27:14 EST 2000


wware at world.std.com (Will Ware) writes:

> being done in Python but of course the syntax would be much uglier. Also,
> I'm not 100% certain of that, because running Python code causes a
> counter (called uthread_ticker) to count down, and when it hits zero,
> a context switch occurs, and to you that appears to be an invisible
> background task. So you'd need to explicitly step down that counter and

Do I understand correctly that microthreads are handled completely in
the Python interpreter, with no OS support at all? In that case,
there is no way to profit from multiple processors, or even to let
other threads continue when one is waiting for I/O etc.

> background task. So you'd need to explicitly step down that counter and
> allow the context switching code to run, and I'm not sure how you'd do
> that unless you allowed yourself to return out to the Python world. So

I suppose that a callback to the interpreter could be provided for
this. But that sounds much like "cooperative multitasking", i.e. a
real headache for programmers. Not to mention the difficulties with
using library routines: what am I supposed to do with a 1000 line
Fortran routine that takes 30 minutes to execute? Analyze the code
and insert lots of task switch calls?
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------



More information about the Python-list mailing list