Hi, I am developing a new app based on OSG 3.2.1.
For better download speed, I used a multi-threaded by following code in JNI: ================== void OsgMainApp::loadModels() { if (_vModelsToLoad.size() == 0) return; osg::notify(osg::ALWAYS) << "There are " << _vModelsToLoad.size() << " models to load" << std::endl; _vTileInfoList.clear(); downloadCacheXMl(); _vTileInfoList = loadDataFromCacheXML(); osgViewer::Viewer::Windows windows; _viewer->getWindows(windows); for (osgViewer::Viewer::Windows::iterator itr = windows.begin(); itr != windows.end(); ++itr) { (*itr)->getState()->setUseModelViewAndProjectionUniforms(true); (*itr)->getState()->setUseVertexAttributeAliasing(true); } _manipulator->getNode(); _viewer->home(); _viewer->getDatabasePager()->clear(); _viewer->getDatabasePager()->registerPagedLODs(_root.get()); _viewer->getDatabasePager()->setUpThreads(3, 2); _viewer->getDatabasePager()->setTargetMaximumNumberOfPageLOD(2); _viewer->getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true, true); ===================== I set the _viewer->getDatabasePager()->setUpThreads(3, 2); , but it often crashed. However if I set _viewer->getDatabasePager()->setUpThreads(3, 2);, it is running smoothly. Here is the crash call stack: ********** Crash dump: ********** Build fingerprint: 'Xiaomi/lcsh92_wet_jb9/lcsh92_wet_jb9:4.2.2/JDQ39/JHDCNBH37.0:user/release-keys' pid: 22182, tid: 22479, name: Thread-9008 >>> osg.AndroidExample <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000 Stack frame I/DEBUG (22507): #00 pc 00000000 <unknown>: Unable to open symbol file D:\mobile\workspace\osgViewer\obj\local\armeabi-v7a\/<unknown>. Error (22): Invalid argument Stack frame I/DEBUG (22507): #01 pc 00481887 /data/app-lib/osg.AndroidExample-1/libosgNativeLib.so (osg_curl::ReaderWriterCURL::readFile(osg_curl::ObjectType, std::string const&, osgDB::Options const*) const+630): Routine osg_curl::ReaderWriterCURL::readFile(osg_curl::ObjectType, std::string const&, osgDB::Options const*) const at Z:/Code/OpenSceneGraph-3.2.1/src/osgPlugins/curl/ReaderWriterCURL.cpp:604 ======================== How to solve this problem ? Thanks. Regards 夏清然 Xia Qingran qingran....@gmail.com http://www.qingran.net
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org