How to create a Panda Thread

Hey

I have a task I would like to move into a thread of its own, but I havn’t been able to figure out how to do it with the Thread class provided by panda3d.

There is no tutorial or explanation that I can find and a lot of the things are Undocumented. One place in the manual it says “See the section Task Chains” but I’ve been unable to find that section =/

What I want to do is move a function, I have registered with the task manager to its own separate thread - fairly simple.

Anyone how has a simple working example of how to set up a thread and start it? I would love to have a look at it =)

/Hesel

Actually, this feature isn’t supported as of Panda3D 1.5.3. The documentation that mentions it is just a little ahead of its time.

It will be supported in the future 1.6 release. As of Panda3D 1.5 or earlier, threading is not a good idea with Panda at all, because it is not compiled with threading protections enabled.

David

Thread class? You mean the one from direct.stdpy.thread(ing)? Those are actually panda3d-safe equivalents of the standard Python thread and threading modules. They work pretty much the same as Python’s standard thread modules.
I believe they don’t have much effect though since threading is not enabled in the default build – it will be, in 1.6.0, though.

Also, the “undocumented” you’re seeing in much places is actually a bug in the program that auto-generates the API reference. It will be fixed very soon.

EDIT: oops, drwr beat me :slight_smile:

Alrighty - gotta find a plan B then =)
Thanks for the response - saved me a lot of searching time

/Hesel