-
Book Overview & Buying
-
Table Of Contents
OpenSceneGraph 3.0: Beginner's Guide
OpenThreads is a lightweight, cross-platform thread API for OSG classes and applications. It supports the fundamental elements required by a multithreaded program, that is, the thread object (OpenThreads::Thread), the mutex for locking data that may be shared by different threads (OpenThreads::Mutex), barrier (OpenThreads::Barrier), and condition (OpenThreads::Condition). The latter two are often used for thread synchronization.
To create a new thread for certain purposes, we have to derive the OpenThreads::Thread base class and re-implement some of its virtual methods. There are also some global functions for conveniently handling threads and thread attributes, for example:
The GetNumberOfProcessors() function gets the number of processors available for use.
The SetProcessorAffinityOfCurrentThread()function sets the processor affinity (that is, which processor is used to execute this thread) of the current thread. It should be called when the thread is currently running...
Change the font size
Change margin width
Change background colour