[Bf-python] Start threads while running the GameEngine, Blender 2.46 and Apricot branch

Willian Padovani Germano wpgermano at gmail.com
Tue Jul 1 22:12:40 CEST 2008


Hi,

Martin Sell wrote:
> Hi, I got a problem with the new Blender versions 2.46 and Apricot branche.
> With version 2.45, I was able to start multiple threads to access the 
> Wii controller interface
> with the Python OSC implementation over a socket connection.
> 
> In the new Versions the Threads arn't executed anymore. After I quit the 
> game, the run() method is
> is only executed once...

To support pynodes we had to make Python thread-safe in Blender. Also, 
because pynodes were giving different results depending on the number of 
rendering threads and might even crash (race conditions), as a test I 
disabled the releasing of Python's global interpreter lock (GIL) by 
setting release time to max int in Blender.

More info: http://wiki.blender.org/index.php/BlenderDev/BPythonAPI/Threads

That fixed pynodes related troubles and nobody reported problems with it 
(afaik), but you may have found a case where it breaks things. So please 
try this:

In Blender's Text Editor create a script with these two lines:

import sys
sys.setcheckinterval(100)

Run it (ALT+p) and then try your script(s). If they work fine you can 
add these two lines in your scripts as a workaround.

Please tell us if this fixes the problem.

-- 
Willian



More information about the Bf-python mailing list