returning a value from a thread
apardon at forel.vub.ac.be
Mon Jul 19 15:48:01 CEST 2004
Op 2004-07-16, David Bolen schreef <db3l at fitlinxx.com>:
> [ ... ]
> The way I tend to think of it is that Python's job (from the
> perspective of supporting a multi-threaded application) is to ensure
> that its native data types remain internally consistent, in terms of
> providing their proper functionality, in the presence of multiple
> threads, but nothing more. Anything above that level is the
> application's responsibility, and in almost all cases means you need
> your own synchronization control to manage any state information.
> Lastly, while this discussion has been, I believe, CPython specific
> due to the GIL, for my part I have believed the prior point (basic
> built-in object internal consistency) to be true in any Python
> implementation, including Jython, but can't recall if I saw that
> stated anywhere, so I suppose it's possible there may be some
> additional risk in Jython or other implementations.
Thanks for the explanation.
I still have a question. Is the GIL necessary even if there is
no sharing of data between threads?
More information about the Python-list