Hello Mathias,
Mathias Otto wrote:
> I have got a problem concening shareing a geometry core on a lower level. So
> I
> have some scenarios with many objects, all stored in obj files. Therefor I
> wrote
> my own loader that shares materials amd merges geometries really fast. Those
> geometries are stored in a search tree, so I can efficiently look up, if a
> file
> is already loaded. Than I want to share the fields of the geometry for a new
> node. This works fine with medium scenarios. But for example with 20000 eqal
> trees occurs an error (bad allocation). The last line in the console is:
>
> /WARNING: Compacting ChangeList .../
this messages is printed if adding a new entry to the changelist failed
and it attempts to reduce its memory consumption. I assume you actually
want to use multiple aspects for multi-threading (if not remove the call
to ChangeList::setReadWriteDefault(true) before osgInit).
To avoid the error you see, you need to apply the changelist to the
other aspects and clear it at regular intervals during load.
Pseudo code for this would look something like:
for each aspect i other than the loader threads:
{
start a thread on aspect i which does:
ChangeList *loaderCL =
Thread::find("loaderThread")->getChangeList();
loaderCL->apply();
join the thread
}
// clear the changelist
Thread::getCurrent()->getChangeList()->clearAll();
The syncing threads probably could run in parallel with a barrier before
the clearAll call.
> Here is my code that should share the geometries:
[snip]
> It is strange, when I share the whole geometry, then it works:
[snip]
This code will create fewer entries in the changelist, but if you used
many more objects you would encounter the same problem.
> But in this case my interaction concept does not work!
Hope it helps,
Carsten
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users