Comment 6 for bug 1202448

Revision history for this message
rdb (rdb) wrote : Re: [Bug 1202448] Re: Deadlock when creating geometry in worker thread

Ugh, I stayed up all night for this but I couldn't figure it out. I know
the following; when the deadlock happens:
* GeomVertexData constructor initializes a PipelineCycler.
* The PipelineCycler constructor calls Pipeline::add_cycler() to add itself.
* However, at that time, the Pipeline mutex is being held by
Pipeline::cycle().
* Pipeline::cycle() deadlocks on the lock of one of the cyclers.

I have not been able to find out which cycler could be locked at that
point. It's certainly not the newly constructed cycler.
Any ideas?

On 8 August 2013 20:34, David Rose <email address hidden> wrote:

> This is definitely on my radar, and I hope to get a chance to
> investigate it soon. Unfortunately I've been overbooked the past couple
> of weeks and haven't had much chance to look at these and other issues.
>
> --
> You received this bug notification because you are subscribed to
> Panda3D.
> https://bugs.launchpad.net/bugs/1202448
>
> Title:
> Deadlock when creating geometry in worker thread
>
> Status in Panda3D:
> Confirmed
>
> Bug description:
> I create complex geometry in a worker thread and attach it to the
> scene graph in my main thread. This works fine unless I attempt to
> enable the multithreaded render pipeline in my prc, including "/Draw",
> "Cull/Draw", and other models.
>
> When the multithreaded render pipeline is enabled, my application
> hangs in a deadlock. The two threads fighting over mutices are the
> main thread (acquiring a lock inside Panda's do_frame()), and my
> worker thread (holding a lock inside the GeomVertexData()
> constructor).
>
> I encountered this problem in C++ against Panda 1.8.1, and it seems to
> occur whenever a user generates custom geometry in a worker thread or
> whenever a model is loaded in a worker thread. I've attached a repro
> test case written in Python, just be sure to add "threading-model
> Cull/Draw" to your .prc.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/panda3d/+bug/1202448/+subscriptions
>