CRI ADX  Last Updated: 2024-07-17 10:47 p
Changing Thread Framework

Samples Directory

/CRIWARE/SDK/pc/samples/criatomex/thread_framework


Sample Description

In order to change thread framework, specify a thread model when initializing the library.

Multithread Mode
When CRI Atom is initialized in multithread mode, server processing is performed periodically in the thread with high priority other than main thread.

CriAtomExConfig atomex_config;
/* Initialize the library setting with default value */
/* Specify multithread mode */
/* Initialize */
criAtomEx_Initialize(&atomex_config);
CriBool criAtomEx_Initialize(const CriAtomExConfig *config, void *work, CriSint32 work_size)
Initialize the library.
#define criAtomEx_SetDefaultConfig(p_config)
Assign the default values to the configuration structure used for the library's initialization.
Definition: cri_le_atom_ex.h:322
@ CRIATOMEX_THREAD_MODEL_MULTI
Multithreading.
Definition: cri_le_atom_ex.h:1227
Configuration structure used to initialize the Atom libraryThis structure is used to specify the beha...
Definition: cri_le_atom_ex.h:1461
CriAtomExThreadModel thread_model
Threading model.
Definition: cri_le_atom_ex.h:1468


Single Thread Mode
When CRI Atom is initialized in single thread mode, server processing is executed in the criAtomEx_ExecuteMain function.
Therefore, application must take care of the execution timing and interval of the criAtomEx_ExecuteMain function and.

CriAtomExConfig atomex_config;
/* Initialize the library setting with default value */
/* Specify multithread mode */
/* Initialize */
criAtomEx_Initialize(&atomex_config);
@ CRIATOMEX_THREAD_MODEL_SINGLE
Single threading.
Definition: cri_le_atom_ex.h:1279


When you do not omit configuration parameters when initializing the library or creating handles, be sure to initialize the parameter structure with corresponding default value setting macro.