I went ahead and looked it up:
http://www.parrotcode.org/docs/pdd/pdd25_concurrency.html
Note that this is a design document although there is some discussion
of implementation. I don't know how much of the design has been
implemented, but the file src/scheduler.c
(
http://svn.perl.org/viewvc/parrot/trunk/src/scheduler.c?view=log)
does have code in it.
The JVM provides (if memory serves) just one construct to manage
concurrency, the monitor, which uses locks on objects to do its job.
Voila! Support for multithreading, etc. in one fell swoop since
everything else is implemented in class libraries.
So, yes, concurrency is about data safety and liveliness, but the
theory of the underlying implementation can be quite simple. Of
course, the implications of the model (the practice) can take years to
get completely correct, as in the Java case.
XEmacs on top of Parrot anyone? ;-)
--- Vladimir
P.S. In theory, practice and theory are the same. In practice, they
are different.
on 02/03/2008 01:00 AM Stephen J. Turnbull said the following:
Vladimir G. Ivanovic writes:
> on 02/02/2008 12:54 AM Stephen J. Turnbull said the following:
> > I've been following Python for
> > years and they still don't have an alternative to the Global
> > Interpreter Lock AFAIK.
>
> Does Parrot support multiple threads?
I don't know, but I would think any news that Parrot supports multiple
threads well would set python-dev on fire, and I haven't noticed any
firetrucks (except the ones heading toward San Diego :-( ) recently.
My understanding from the discussions on python-dev and from Simon
Peyton-Jones's chapter "Beautiful Concurrency" in _Beautiful Code_ is
that multithreading is not about the execution model (ie, the
interpreter per se) as it is about the data model. The problem is
developing ways for the language to mark some data as safe, so that
the interpreter doesn't need to lock them, while others are vulnerable
to reentrancy etc and need to be protected. Interpreter reentrancy
per se is important, but it's a bounded task. Fixing the language is
not.
--
Vladimir G. Ivanovic
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta