develooper Front page | perl.perl6.internals | Postings from August 2002

Microthreads

From:
Paul Fisher
Date:
August 24, 2002 15:44
Subject:
Microthreads
Message ID:
20020824224404.GC15873@gnu.org
Are there plans to have Parrot support lightweight preemptive
threading (aka microthreads), along the lines of most multi-threaded
Scheme implementations?

Since Parrot already has coroutines, which are essentially a means for
lightweight non-preemptive threading, couldn't a scheduler be added
that would cause Parrot to force a yield on a new PMC (ex:
Microthread) after every few op codes?  If so, I might be interested
in implementing this.

Dan posted a message back in October stating that Parrot would have
"one thread per interpreter".  I assume this refers to traditional
heavyweight threads -- that is, having context switching occur outside
the Parrot VM (possibly with pthreads, for example).

I'd like to end up with an environment that makes it possible to
multiplex thousands of lightweight threads across a small set of
heavyweight threads (where the heavyweight threads are OS-level
threads and generally equal to the number of physical CPUs).  It's
also critical that continuations created by one thread can be invoked
by another.

My current research code only works on a select few Scheme
implementations (mainly because of the continuation requirement), but
I'm interested in porting that work to run on Parrot.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About