[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] More optimisation questions



Hi Pete,

Thanks for the message.

This is exactly what I do. A background thread is calling the load and
tostring code. When those are ready, I change a flip and then the
store and subimage2d is called in the main thread (where the flip() is
happening).

I thought that simply trying to call the above snippet in a different
thread would work but clearly not :)

Is there some guidelines in writing multithreaded OpenGL code?

I am also worried that i might be a casualty of the GIL. If separate
thread takes hold of the CPU for too long, (even if really 4 lines of
python) could I hit the problem that my main thread gets to wait a bit
too long to get the GIL?

At the beginning BOTH the image loading and tostring were done in the
main thread and this made a very LONG glitch. Now it just seems to be
a one frame glitch
The CPU is a Pentium M 1.5 Ghz and the GFX Board is  a ATI Mobile Radeon 9600.

I will clean up the code and post it later for people who want to see
really dirty opengl code.

Regards,

Guillaume