Strange threading behaviour
Rotwang
sg552 at hotmail.co.uk
Thu Jun 21 14:14:32 EDT 2012
On 21/06/2012 18:26, Dieter Maurer wrote:
> Rotwang<sg552 at hotmail.co.uk> writes:
>
>> [...]
>>
>> Can anyone help?
>
> It looks as if some waiting operation
> in the "wait_window" call did not release the GIL (the "Global Interpreter
> Lock" which ensures that at most one Python thread can run at a given
> time and protects the Python data structures such as the reference counts
> and interpreter state).
>
> In this case, you could expect some non-deterministic behaviour.
> If your thread is fast enough to finish before the internal
> activity inside "wait_window" gets the GIL again,
> everything completes immediately; otherwise, things complete
> only after the internal waiting ends and Python code is again executed.
OK, that makes sense - it could certainly explain why the print and open
commands worked fine but the thread got stuck at pickle.dump. Thanks.
--
Hate music? Then you'll hate this:
http://tinyurl.com/psymix
More information about the Python-list
mailing list