Issues with multi-threading and compound shapes

Post Reply
desaic
Posts: 2
Joined: Wed Oct 27, 2021 7:48 pm

Issues with multi-threading and compound shapes

Post by desaic »

I'm working on a demo with both compound shapes and multi-threading. I observed the number of contact manifolds keep increasing overtime (m_manifoldsPtr in btCollisionDispatcherMt), this eventually slows down the simulation. I did a few experiments and here is what I found:

When using both multi-threading and compound shapes, the function btCollisionDispatcherMt::releaseManifold will be called, but the variable m_batchUpdating will always be true during the simulation. Then I found the compoundcompound collision algorithm will attempt to deallocate collision algorithms while it is processing collisons. When the collision algorithm deallocates, it will release the contact manifold and in then calls the btCollisionDispatcherMt::releaseManifold. But because this funciton is called while the compound algorithm is processing collisions, the member m_batchUpdating will always be true, because the collision is processed in the parallel for after m_batchUpdating is set to true. As a result, this section of the code will never get run during the simulation and m_manifoldsPtr will keep increasing.

Is this a potential bug, or I'm missing something?
User avatar
KKlouzal
Posts: 65
Joined: Thu Mar 06, 2014 5:56 am
Location: USA - Arizona

Re: Issues with multi-threading and compound shapes

Post by KKlouzal »

I seem to be having this same issue however it's only happening on 1 of my 5 test machines.
Post Reply