Multi threading panda3d and to optimize code control

I have a panda code, how do i explictly force to use a different thread than the c++ code which started it,
ie i have a program after i call framework.main_loop the control of the execution goes out of my hand and to execute statements i have to rely on tasks can we avoid this? ie is there a way to keep the panda rendering and also execute the cpp code at the same time?

Have you see this blog post?