Threading in game engine? [SOLVED]

Thanks for suggestions!

I’ve been playing around with different approaches. I sort of got multiprocessing working but I didn’t manage to terminate them properly. No big problem since threads are enough in this case.

Using only threads things worked ok except updating textures with videotexture. It seems that I cannot use videotexture from a thread. Here is a back trace from one attempt:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb06b0b70 (LWP 2437)]
0x002e4368 in ?? () from /usr/lib/libGLU.so.1
(gdb) bt
#0  0x002e4368 in ?? () from /usr/lib/libGLU.so.1
#1  0x002ea9fc in gluScaleImage () from /usr/lib/libGLU.so.1
#2  0x08e05731 in Texture_refresh(Texture*, _object*) ()
#3  0x092486f0 in PyEval_EvalFrameEx ()
#4  0x0924933d in PyEval_EvalFrameEx ()
#5  0x0924933d in PyEval_EvalFrameEx ()
#6  0x0924933d in PyEval_EvalFrameEx ()
#7  0x09249ea1 in PyEval_EvalCodeEx ()
#8  0x091f86ba in ?? ()
#9  0x091e08bd in PyObject_Call ()
#10 0x091ece4f in ?? ()
#11 0x091e08bd in PyObject_Call ()
#12 0x09242932 in PyEval_CallObjectWithKeywords ()
#13 0x0927e92f in ?? ()
#14 0x0077396e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#15 0x006b7a4e in clone () from /lib/tls/i686/cmov/libc.so.6

The idea was to download an image and change it in the thread, so that game engine wouldn’t have to wait. This may not be possible?

If nothing else helps, then I’ll make a preload script that collects all the data to files on engine start.