1 Jan 2006 13:48
Re: Thread/gil/java question
Armin Rigo <arigo <at> tunes.org>
2006-01-01 12:48:32 GMT
2006-01-01 12:48:32 GMT
Hi,
On Fri, Dec 30, 2005 at 12:47:38AM +0100, Christian Tismer wrote:
> you already got a very good answer, since you happened to hit
> the former maintainer of Jython.
Christian's answer is a bit too harsh IMHO. I don't think we should try
to keep open discussions off pypy-dev, at least as long as they don't
become long threads where every answer is just uninformed guesses and
wild speculations building on each other. I don't see pypy-dev in
danger of becoming that at the moment.
> >Thank you for the quick response. Let me get this straight: If I use
> >Jython instead of CPython, then my Python threads can migrate to
> >different CPUs?
Yes.
> >Not sure what you meant by "... granularity is such that not much could
> >be assumed for user programs..."--could you clarify that a bit?
In CPython, if say 'd' is a dict, then 'd.setdefault(x,y)' is atomic, so
the result cannot be messed up by another thread accessing 'd' at the
same time. In Java you don't have complex operations, so you (or a Java
library) would have to write code like:
if (d.hasKey(x)) {
return d.get(x);
}
else {
(Continue reading)
RSS Feed