1multithreading_support(3) Coin multithreading_support(3)
2
3
4
6 multithreading_support - Multithreading Support in Coin The support in
7 Coin for using multiple threads in application programs and the Coin
8 library itself, consists of two main features:
9
10 • Coin provides platform-independent thread-handling abstraction
11 classes. These are classes that the application programmer can freely
12 use in her application code to start new threads, control their
13 execution, work with mutexes and do other tasks related to handling
14 multiple threads.
15 The classes in question are SbThread, SbMutex, SbStorage, SbBarrier,
16 SbCondVar, SbFifo, SbThreadAutoLock, SbRWMutex, and SbTypedStorage. See
17 their respective documentation for the detailed information.
18 The classes fully hides the system-specific implementation, which is
19 either done on top of native Win32 (if on Microsoft Windows), or over
20 POSIX threads (on UNIX and UNIX-like systems).
21 • The other aspect of our multi-threading support is that Coin can be
22 specially configured so that rendering traversals of the scene graph
23 are done in a thread-safe manner. This means e.g. that it is possible
24 to have Coin render the scene in parallel on multiple CPUs for
25 multiple rendering pipes, to better take advantage of such high-end
26 systems (like CAVE environments, for instance).
27 Thread-safe render traversals are off by default, because there is a
28 small overhead involved which would make rendering (very) slightly
29 slower on single-threaded invocations.
30 To get a Coin library built with thread-safe rendering, one must
31 actively re-configure Coin and build a special, local version. For
32 configure-based builds (UNIX and UNIX-like systems, or with Cygwin on
33 Microsoft Windows) this is done with the option '--enable-threadsafe'
34 to Autoconf configure. To change the configuration and re-build with
35 Visual Studio, you will need to change the preprocessor directive
36 COIN_THREADSAFE to defined in the file src/setup.h located in the same
37 folder as you found your solution file.
38 There are some restrictions and other issues which it is important to
39 be aware of:
40 • We do not yet provide any support for binding the multi-threaded
41 rendering support into the SoQt / SoWin / etc GUI bindings, and
42 neither do we provide bindings against any specific library that
43 handles multi-pipe rendering. This means the application programmer
44 will have to possess some expertise, and put in some effort, to be
45 able to utilize multi-pipe rendering with Coin.
46 • Rendering traversals is currently the only operation which we
47 publicly support to be thread-safe. There are other aspects of Coin
48 that we know are thread-safe, like most other action traversals
49 beside just rendering, but we make no guarantees in this regard.
50 • Be careful about using a separate thread for changing Coin structures
51 versus what is used for the application's GUI event thread.
52 We are aware of at least issues with Qt3 (and thereby SoQt), where you
53 should not modify the scene graph in any way in a thread separate from
54 the main Qt thread. This because it will trigger operations where Qt3
55 is not thread-safe. For Qt4, we have not been aware of such problems.
56 Since
57 Coin 2.0
58Version 4.0.0 Wed Jul 20 2022 multithreading_support(3)