http://blog.csdn.net/butwang/article/details/6219424
在OgreConfig.h文件中有关于Ogre使用多线程的配置
1. 多线程支持的级别
2.支持多线程库的thread lib来源
/** Provider for threading functionality, there are 4 options.
OGRE_THREAD_PROVIDER = 0
No support for threading.
OGRE_THREAD_PROVIDER = 1
Boost libraries provide threading functionality.
OGRE_THREAD_PROVIDER = 2
Poco libraries provide threading functionality.
OGRE_THREAD_PROVIDER = 3
TBB library provides threading functionality.
*/
#ifndefOGRE_THREAD_PROVIDER
#define OGRE_THREAD_PROVIDER 0
#endif
2.1 一个是boost提供的线程库
2.2 一个是Poco libraries
POCO C++ Libraries 提供一套 C++ 的类库用以开发基于网络的可移植的应用程序,功能涉及线程、线程同步、文件系统访问、流操作、共享库和类加载、套接字以及网络协议包括:HTTP、FTP、SMTP 等;其本身还包含一个 HTTP 服务器,提供 XML 的解析和 SQL 数据库的访问接口。
http://www.google.com.hk/search?hl=zh-CN&source=hp&biw=1241&bih=575&q=Poco+libraries&aq=f&aqi=&aql=&oq=
2.3 TBB library
http://threadingbuildingblocks.org/
Intel® Threading Building Blocks (Intel TBB) offers a rich and complete approach to expressing parallelism in a C++ program. It is a library that helps you take advantage of multi-core processor performance without having to be a threading expert. Intel TBB is not just a threads-replacement library. It represents a higher-level, task-based parallelism that abstracts platform details and threading mechanisms for scalability and performance.
3.Ogre多线程的初始化
在OgreMain中搜索OGRE_THREAD_SUPPORT得出以下文件清单
3.1分析OgreRoot.cpp中有关OGRE_THREAD_SUPPORT的代码:
Ogre 1.7 的 Threading changes
备注:1.7添加了一个Character Sample,其中SinbadCharacterController有参考价值。
采用OGRE_THREAD_SUPPORT = 1并不被推荐,而应该使用OGRE_THREAD_SUPPORT = 2。sinbad在Using the new threading scheme说明了原因。更具体的讨论在high performance thread support - request for comments。当前,有Proposal: OGRE_THREAD_SUPPORT == 3,但是没有整合到Ogre 1.7中。
关于多线程参考:多线程的渲染与物理模拟(pdf)和Threading the OGRE3DRender System(pdf)
2010/07/07刷新:关于WorkQueue可以参考OGRE多线程的使用
PS. 在用CMake编译Ogre时,通过以下两个选项配置Ogre对多线程的支持: