EM-ODP 4.4.0
Event Machine on ODP
Loading...
Searching...
No Matches
em_conf_local_t Struct Reference

#include <event_machine_init.h>

Data Fields

em_core_type_t core_type
 
int core_id
 
em_input_poll_func_t input_poll_fn
 
em_output_drain_func_t output_drain_fn
 
uint32_t __internal_check
 

Detailed Description

Event Machine thread-local configuration options for em_init_local()

Examples
bench_event.c, bench_pool.c, and dyn_cores.c.

Definition at line 300 of file event_machine_init.h.

Field Documentation

◆ __internal_check

uint32_t em_conf_local_t::__internal_check

Internal check - don't touch!

EM will verify that em_conf_local_init() has been called before calling em_init_local().

Definition at line 362 of file event_machine_init.h.

◆ core_id

int em_conf_local_t::core_id

Requested core-id for this EM-core - or let EM assign.

Use '-1' to let EM assign the core-id (default & recommended):

  • EM-cores will be assigned an id in startup/init order regardless of the actual physical CPU ids.

Use '0' to 'core_count - 1' to request a specific core-id:

  • An id will be assigned based on the user provided 'core_id'.
  • The user must ensure that the requested 'core_id' is not already in use or EM local initialization will fail!

The max value is set by em_conf_t::core_count, thus the allowed range is from 0 to 'core_count - 1' (where 'core_count' <= EM_MAX_CORES).

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.

Only valid for EM-cores of the type EM_CORE_TYPE_WORKER and EM_CORE_TYPE_CONTROL. Ignored for EM external threads/processes: EM_CORE_TYPE_EXTERNAL.

Definition at line 329 of file event_machine_init.h.

◆ core_type

em_core_type_t em_conf_local_t::core_type

Worker/control EM-core or external thread (mandatory)

Examples
bench_event.c, bench_pool.c, and dyn_cores.c.

Definition at line 304 of file event_machine_init.h.

◆ input_poll_fn

em_input_poll_func_t em_conf_local_t::input_poll_fn

User provided function, called from within the EM-dispatch loop, mainly for polling various input sources for events or pkts and then enqueue them into EM. Set to 'NULL' if not needed (default).

Only valid for EM-cores of the type EM_CORE_TYPE_WORKER and EM_CORE_TYPE_CONTROL. External threads do not dispatch and can thus not utilize this functionality.

Definition at line 341 of file event_machine_init.h.

◆ output_drain_fn

em_output_drain_func_t em_conf_local_t::output_drain_fn

User provided function, called from within the EM-dispatch loop, mainly for 'periodical' draining of buffered output to make sure events/pkts are eventually sent out even if the rate is low or stops for a while. Set to 'NULL' if not needed (default).

Only valid for EM-cores of the type EM_CORE_TYPE_WORKER and EM_CORE_TYPE_CONTROL. External threads do not dispatch and can thus not utilize this functionality.

Definition at line 354 of file event_machine_init.h.


The documentation for this struct was generated from the following file: