Question about Python threads
a-steinhoff at web.de
Wed Aug 28 04:00:25 EDT 2002
Artur Biesiadowski <abies at pg.gda.pl> wrote in message news:<akguhv$1i257h$1 at ID-107541.news.dfncis.de>...
> Gerhard Häring wrote:
> > In Python, everything is an object, including ints, ... so two threads
> > manipulating the refcount of an object at the same time will certainly
> > crash the interpreter sooner or later. AFAIK Java objects don't have
> > refcounts, right?
> No, it does not use refcounts, it is not a good idea for anything else
> than niche languages or special objects (for example strings).
> JVM has quite well defined semantics in presence of multiple threads
> (including multiple processors). There are some small problems with
> multiprocessor cache and synchronization - java memory model is in
> process of being relaxed to allow optimized implementation.
So the 'well defined semantic' isn't yet very well defined ... the
processing model of JVM is at the end also not designed for
[ clip ..]
> Generally, JVM is not allowed to crash in ANY situation.
It's also valid for Python.
>Of course, real
> life is less perfect and JVMs are known to crash sometimes - but this is
> mostly when interacting with native libraries, performing some kind of
> complicated graphics or working with gigabytes of memory used.
The same can happen with Python extensions :)
More information about the Python-list