[Stackless] Population simulation in Stackless

Simon Frost sdfrost at ucsd.edu
Mon Aug 26 19:57:34 CEST 2002

Dear Chris and Aaron,

At 09:09 PM 8/24/2002 +0200, you wrote:
>Aaron Watters wrote:
>>sdfrost at UCSD.Edu wrote:
>>>Dear Aaron,
>>>Thanks for the link.  I've a quick question regarding your scheduler that I
>>>hope isn't too dumb.  When I start it up on a two processor machine, the 
>>>isn't balanced; I get the equivalent of 1 cpu's worth (which might be 
>>>100+0 or
>>>90+10 or 65+35).  Given that tasktest.py balances just fine, what 
>>>restricts the
>>>balancing in world_new?
>Which tasktest.py are you referring to? Mine?
>I have no idea how a two processor machine handles
>stacks. I can manage only one stack at all, and
>if you try to switch between tasklets of different
>threads, you will crash badly.

I'm referring to your test programs.  When I run them on a dual processor 
machine, the load is balanced between them.

>Is two processors like two threads? Same memory,
>different stacks, and you need the lock?
>The I have a reason to learn how to do this, now.
>I thought never to need threads. But if this brings
>a new CPU :-))

You do need the lock, so Python doesn't scale to SMP as well as Jython, 
which links to Java threads

I was curious that I can launch lots of threads in the test programs and 
get balanced loads, whereas Aaron's scheduler only used one processor.

The reason for my interest is that I currently have a (very crude) 
simulation program written in Python (pre-generator!) where I have a 
scheduler that performs functions on objects.  I'm running it on my Beowulf 
(9 dual-processor nodes). I can parallelize different runs using MPI (I use 
pypar), but I thought it would be nice to use microthreads; in principle, I 
could pickle threads and pass them via MPI to other machines in the cluster 
(pypar can support the distribution of anything pickle-able, I 
believe).  The threads do need to interact with each other (at least in the 
same SMP environment), with variables in one thread being updated depending 
upon variables in other threads at a given 'time' in the simulation, and 
this is where I'll get stuck, I believe.


Simon D.W. Frost, M.A., D.Phil.
Department of Pathology
University of California, San Diego
Antiviral Research Center
(Formerly: UCSD Treatment Center)
150 W. Washington St., Suite 100
San Diego, CA 92103

Stackless mailing list
Stackless at www.tismer.com

More information about the Stackless mailing list