Stackless/microthreads merge news

Neel Krishnaswami neelk at brick.cswv.com
Tue May 2 22:38:05 EDT 2000


Christian Tismer <tismer at tismer.com> wrote:
> Will Ware wrote:
> > 
> > There is a free software implementation of the JVM with available
> > source code, called Kaffe, at
> >
> > http://www.transvirtual.com/products/downloads.html
> >
> > If a stackless version of Kaffe could be developed, it might be
> > possible to convince Kaffe's maintainer (Tom Wilkinson, owner of
> > the transvirtual.com site) to fold the changes into its official
> > distribution. It would give him an advantage over Sun, so before
> > too long, they might follow suit.
> 
> Hey, this is just an incredible idea.  Java with first class
> continuations, let that drop through your brains. 90 percent of java
> threads would be replaced by microthreads.
> 
> I will read the Kaffe source and think how this must be.

Fairly difficult, I would assume -- if there's a JIT it will almost
certainly try to stack-allocate activation records. You'd need to
explictly heap-allocate all that. Fortunately, Andrew Appel seems
to believe that heap-allocation of frames can effectively compete
with stack allocation, see:

  Garbage collection can be faster than stack allocation. Andrew
  W. Appel.  Information Processing Letters 25(4):275-279, 17 June
  1987.

and 

  Simple Generational Garbage Collection and Fast Allocation. Andrew
  W. Appel.  Software--Practice and Experience 19(2):171-183, February
  1989.

You can find these papers at:
  
  http://www.cs.princeton.edu/~appel/papers/


Neel



More information about the Python-list mailing list