There are two types of parallelism built into raylib: thread parallelism on shared-memory systems, and network parallelism. Raylib attempts to run one process or thread (optionally, if available) on each CPU on the network. On multiprocessor shared-memory systems, the scene database is stored in shared memory and can be accessed by all rendering processes. Network parallelism cannot share data this way; it requires multiple copies of the database in each host's local memory. The DB module handles all network transfers of database items. All network transfers rely on message passing.
A multi-threaded application integrating Raylib may access the library from different threads. In order to do so, each of the application threads calling Raylib functions should be registered in Raylib. A registered thread should unregister itself before shutdown. It is possible to re-register an unregistered thread again. The thread which initializes Raylib is automatically registered, and should not be unregistered.
API functions use thread local storage and are not thread-safe. In particular, it is not possible to switch thread between mi_api_*_begin and mi_api_*_end calls.
miThreadID mi_msg_register_thread(void)
This function registers an application thread in Raylib.
void mi_msg_unregister_thread(void)
This function unregisters previously registered thread.
Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.