AsyncLoading vs. Cache

I think it can be a bug in Panda3d. I’m not completely sure, but I’ll try to describe what I think and then you guys can tell what’s wrong and what’s right.

Two threads (at least) is running:

  1. BamCache is loading a heavy model, and his ReMutexHolder “_lock” is being held for the multithreaded approach.
  2. The main thread is trying to render the frame. When it comes in GraphicsEngine::render_frame(), the thread try to execute the line 641:
BamCache *cache = BamCache::get_global_ptr();
cache->consider_flush_index();

BamCache::consider_flush_index() uses the ReMutexHolder “_lock” as well, making it wait 'till the model loading is complete to only then release the lock.

So that’s what I think it’s happening :slight_smile:.
Someone can check that for me, please? :wink:

Edit: [Lag with asynchronous model loading) seems to be the exactly same problem.