Stackless Python in Commercial Game Project!

Courageous jkraska1 at san.rr.com
Sat Jun 10 17:35:12 EDT 2000


Magnus Lie Hetland wrote:
> 
> Cool!
> 
> Just a question: What is the motivation for using Stackless Python as
> opposed
> to standard Python here? Threading? (Just curious...)

Stacklessness allows you to context switch at a very rapid
pace, basically. An operating system thread has very high
overhead; this is particularly true when preemptive multi-
tasking doesn't buy you anything, in which case you are
paying context switch overhead costs for context switches
you don't even desire to make.

The usefulness of first class continuations is proven in
massively parallel operating system compilers like CILK,
where none of the procedures make use of the C stack at
all.

(The continuation is an obvious and natural thing to
 follow out of a stackless environment: an object which
 encapsulates the immediate run state of your thread,
 and if restored, restores the state of the thread).


C/



More information about the Python-list mailing list