![]() |
EM-ODP 4.4.0
Event Machine on ODP
|
#include <event_machine_init.h>

Data Fields | ||
| uint16_t | device_id | |
| int | event_timer | |
| int | thread_per_core | |
| int | process_per_core | |
| uint32_t | core_count | |
| em_core_mask_t | phys_mask | |
| em_pool_cfg_t | default_pool_cfg | |
| struct { | ||
| em_log_func_t log_fn | ||
| em_vlog_func_t vlog_fn | ||
| } | log | |
| em_api_hooks_t | api_hooks | |
| em_idle_hooks_t | idle_hooks | |
| uint32_t | __internal_check | |
Event Machine run-time configuration options given at startup to em_init()
The 'em_conf_t' struct should be initialized with em_conf_init() before use. This initialization provides better backwards compatibility since all options will be set to default values. The user must further set the needed configuration and call em_init():
Content is copied into EM by em_init().
Definition at line 100 of file event_machine_init.h.
| uint32_t em_conf_t::__internal_check |
Internal check - don't touch!
EM will verify that em_conf_init() has been called before calling em_init().
Definition at line 216 of file event_machine_init.h.
| em_api_hooks_t em_conf_t::api_hooks |
User provided API callback hooks. Set only the needed hooks to avoid performance degradation. Only used if EM_API_HOOKS_ENABLE != 0
Definition at line 201 of file event_machine_init.h.
| uint32_t em_conf_t::core_count |
Maximum number of concurrently running EM-cores allowed for this EM instance.
The max number of EM-cores is concerned with concurrently running EM-cores of the type EM_CORE_TYPE_CONTROL or EM_CORE_TYPE_WORKER. Additionally the user may create threads/processes of type EM_CORE_TYPE_EXTERNAL that are not included in this max count, see em_core_type_t.
EM-core ids will be assigned from the range of 0 to 'core_count-1' during local initialization. Based on the options given to em_init_local(), EM-cores will either be assigned in startup/init order regardless of the actual physical CPU ids, or, based on the user provided 'core_id'. Note that the range may be discountiguous if the user removes EM-cores from the middle of the range (by calling em_term_local()) or if the user requests specific core-ids with gaps in between.
The largest value that can be used for 'core_count' is the compile- time constant EM_MAX_CORES.
Default value is 0 and needs to be changed by the user.
Definition at line 156 of file event_machine_init.h.
| em_pool_cfg_t em_conf_t::default_pool_cfg |
Pool configuration for the EM default pool (EM_POOL_DEFAULT). Default value is set by em_pool_cfg_init() and needs to be changed by the user.
Note that if the default pool configuration is also given in the config file through option 'startup_pools', it will override this default pool configuration.
Definition at line 182 of file event_machine_init.h.
| uint16_t em_conf_t::device_id |
EM device id - use different device ids for each EM instance or remote EM device that need to communicate with each other. Default value is 0.
Definition at line 106 of file event_machine_init.h.
| int em_conf_t::event_timer |
Event Timer: enable=1, disable=0. Default value is 0 (disable).
Definition at line 112 of file event_machine_init.h.
| em_idle_hooks_t em_conf_t::idle_hooks |
User provided idle callback hooks. Set only the needed hooks to avoid performance degradation. Only used if EM_IDLE_HOOKS_ENABLE != 0
Definition at line 208 of file event_machine_init.h.
| struct { ... } em_conf_t::log |
EM log functions. Default values are NULL and causes EM to use internal default log-functions.
| em_log_func_t em_conf_t::log_fn |
EM log function, user overridable, variable number of args
Definition at line 191 of file event_machine_init.h.
| em_core_mask_t em_conf_t::phys_mask |
Core mask of physical CPUs allowed for EM-cores on this EM instance (this is a physical mask even though the 'em_core_mask_t' type is used).
Similarly to '.core_count', the physical CPU mask is concerned with concurrently running EM-cores of the type EM_CORE_TYPE_CONTROL or EM_CORE_TYPE_WORKER. Additionally the user may create threads/processes of type EM_CORE_TYPE_EXTERNAL that are not included in this mask, see em_core_type_t.
Default value is all-0 and needs to be changed by the user.
Definition at line 171 of file event_machine_init.h.
| int em_conf_t::process_per_core |
RunMode: EM run with one process per core. Set 'true' to select process-per-core mode. Default value is 0.
Definition at line 130 of file event_machine_init.h.
| int em_conf_t::thread_per_core |
RunMode: EM run with one thread per core. Set 'true' to select thread-per-core mode. This is the recommended mode, but the user must explicitly set it to enable. Default value is 0.
Definition at line 122 of file event_machine_init.h.
| em_vlog_func_t em_conf_t::vlog_fn |
EM log function, user overridable, va_list
Definition at line 193 of file event_machine_init.h.