Multithreaded Render Pipeline

Hi to all,

I am using v1.10.0 and I turned on the Multithreaded Render Pipeline by adding this to the Config.prc file:

threading-model Cull/Draw

It did work okay, but at a certain point, when I opened the inventory in the game, everything froze completely. This did not happen when that particular line [threading-model Cull/Draw] was omitted from the Config.prc file. The inventory in the game works by creating 15 display regions, placing the relevant model/actor within that display region, and then rotating it [the model/actor] over time. I also add mouseWatchers for the display regions so that clicking on a particular display region selects the model/actor that is within it.

Any hints as to why, with Multithreaded Render Pipeline enabled, the game freezes under a circumstance like that I described above?


There are certain circumstances in which a deadlock can occur in the multithreaded render pipeline, if two threads are trying to access certain resources at the same time.
This may be a bug in Panda or a bug in your program; it’s not clear which. An example of something that can incur a deadlock is misusing a copy-on-write object, such as storing a Geom or GeomVertexWriter across frames.

There is a known bug where generating custom geometry in the multithreaded pipeline may cause a hang.

Thanks for the answer although I don’t quite understand what you mean by this:

What is a copy-on-write object? How would I store a Geom/GeomVertexWriter across frames? When generating the custom geometry I draw the relevant models through a class method and then dispose of everything involved in the drawing after I’ve generated the models…Forgive my ignorance but when using Panda3D I have so far avoided going beyond a certain layer of depth; otherwise it would take forever to build anything [So to compensate for that I learn as I build; may not be the best thing to do but for now it works]. So I don’t know what that phrase means. Could you kindly direct me to an relevant materials to better familiarize myself with its concept?

Hmm…well if it turns out that it’s not my fault then that would be slightly unfortunate [but not fatalistic] because this program deals a lot with generating things procedurally. There are other ways to increase the speed after all.