AsyncLoading of cached files hangs main thread

Bug #1019599 reported by Jairo Henrique
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Panda3D
Fix Released
Undecided
rdb

Bug Description

Ubuntu 11.04 32, Panda3d nigthlybuild or cvs build or 1.8

There's some information and test code here:
http://www.panda3d.org/forums/viewtopic.php?p=86260#86260

The same problem happens here:
http://www.panda3d.org/forums/viewtopic.php?t=12710

--
What I guess it's wrong:
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:

Code:
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.

Jairo Henrique (heek)
description: updated
Revision history for this message
rdb (rdb) wrote :

Thanks for tracking this issue down! Checked in a fix; consider_flush_index() now skips the operation entirely if it can't grab the lock (it will try again next frame anyway, so it's no big deal).

Changed in panda3d:
assignee: nobody → rdb (rdb)
milestone: none → 1.9.3
status: New → Fix Committed
rdb (rdb)
Changed in panda3d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers