Page 2 of 2

Re: BufferPool problem

Posted: Sat May 16, 2020 11:09 pm
by wanghongliang
Hi,Norbo,thanks for your patience. My app needs to remove/add tons of physical entities(more than 20,000) frequently. When a thread dispatcher is used, the app sometimes endlessly freezes, sometimes crashes due to AccessViolationException. When the thread dispatcher is removed, everything works fine, and to my surprise, the app actually runs faster! So my question is why thread dispatcher is not stable enough and slowing things down?

Re: BufferPool problem

Posted: Sat May 16, 2020 11:18 pm
by Norbo
Are you using multiple threads to add to/remove from the simulation simultaneously, or while the simulation is running? Both will definitely corrupt the simulation and things will fail in arbitrarily bad ways.

If it's not that, the fact that you're seeing access violations means something has gone terribly wrong. Race conditions, buffer overruns, memory corruption, or NaNsplosions are likely.

Re: BufferPool problem

Posted: Sat May 16, 2020 11:57 pm
by wanghongliang
No, I am using the main thread to add to/remove from the simulation. My terrain is huge(512km x 512km) and composed of
1 million patches, and I want to move reusable trees (the total number of trees is more than 40,000,000) and their physical entities( each tree represented as a bunch of convexhulls) from patch to patch. When game scene jumps from one
patch to another, the problem occurs. Maybe I should be responsible for a little bit of abusing Bepu. :lol:

Re: BufferPool problem

Posted: Sun May 17, 2020 4:23 pm
by Norbo
Unfortunately, I don't have enough information to suggest anything in particular. It definitely shouldn't be throwing access violations :P

If you can reproduce it in the demos, I could take a closer look. Grabbing the source and running in debug mode could help too- there are a lot of asserts that would probably catch whatever is going wrong before an access violation (if it's related to engine state).