EM-ODP  3.7.0
Event Machine on ODP
em_queue.h File Reference
#include <stdlib.h>
Include dependency graph for em_queue.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

em_status_t queue_init (queue_tbl_t *const queue_tbl, queue_pool_t *const queue_pool, queue_pool_t *const queue_pool_static)
 
em_status_t queue_init_local (void)
 
em_status_t queue_term_local (void)
 
em_queue_t queue_alloc (em_queue_t queue, const char **err_str)
 
em_status_t queue_free (em_queue_t queue)
 
void queue_setup_common (queue_elem_t *q_elem, const queue_setup_t *setup)
 
em_queue_t queue_create (const char *name, em_queue_type_t type, em_queue_prio_t prio, em_queue_group_t queue_group, em_queue_t queue_req, em_atomic_group_t atomic_group, const em_queue_conf_t *conf, const char **err_str)
 
em_status_t queue_delete (queue_elem_t *const queue_elem)
 
em_status_t queue_enable (queue_elem_t *const q_elem)
 
em_status_t queue_enable_all (eo_elem_t *const eo_elem)
 
em_status_t queue_disable (queue_elem_t *const q_elem)
 
em_status_t queue_disable_all (eo_elem_t *const eo_elem)
 
em_status_t queue_state_change__check (queue_state_t old_state, queue_state_t new_state, int is_setup)
 
em_status_t queue_state_change (queue_elem_t *const queue_elem, queue_state_t new_state)
 
em_status_t queue_state_change_all (eo_elem_t *const eo_elem, queue_state_t new_state)
 
unsigned int queue_count (void)
 
size_t queue_get_name (const queue_elem_t *const q_elem, char name[], const size_t maxlen)
 
void print_queue_info (void)
 
void print_queue_capa (void)
 
void print_queue_prio_info (void)
 
void print_queue_elem_info (void)
 
const char * queue_get_state_str (queue_state_t state)
 
const char * queue_get_type_str (em_queue_type_t type)
 

Detailed Description

EM internal queue functions

Definition in file em_queue.h.

Function Documentation

◆ print_queue_capa()

void print_queue_capa ( void  )

Print queue capabilities

Definition at line 1472 of file em_queue.c.

◆ print_queue_info()

void print_queue_info ( void  )

Print information about all EM queues

Definition at line 1749 of file em_queue.c.

◆ queue_alloc()

em_queue_t queue_alloc ( em_queue_t  queue,
const char **  err_str 
)

Allocate a new EM queue

Parameters
queueEM queue handle if a specific EM queue is requested, EM_QUEUE_UNDEF if any EM queue will do.
[out]err_strOutput var for error message in case of failure.
Returns
EM queue handle
Return values
EM_QUEUE_UNDEFon failure

Definition at line 411 of file em_queue.c.

◆ queue_create()

em_queue_t queue_create ( const char *  name,
em_queue_type_t  type,
em_queue_prio_t  prio,
em_queue_group_t  queue_group,
em_queue_t  queue_req,
em_atomic_group_t  atomic_group,
const em_queue_conf_t conf,
const char **  err_str 
)

Create an EM queue: alloc, setup and add to queue group list

Definition at line 592 of file em_queue.c.

◆ queue_delete()

em_status_t queue_delete ( queue_elem_t *const  queue_elem)

is_setup

Definition at line 652 of file em_queue.c.

◆ queue_disable()

em_status_t queue_disable ( queue_elem_t *const  q_elem)

Disable event reception of an EM queue

Definition at line 1360 of file em_queue.c.

◆ queue_disable_all()

em_status_t queue_disable_all ( eo_elem_t *const  eo_elem)

Disable event reception of ALL queues belonging to an EO

Definition at line 1381 of file em_queue.c.

◆ queue_enable()

em_status_t queue_enable ( queue_elem_t *const  q_elem)

Enable event reception of an EM queue

Definition at line 1319 of file em_queue.c.

◆ queue_enable_all()

em_status_t queue_enable_all ( eo_elem_t *const  eo_elem)

Enable event reception of ALL queues belonging to an EO

Definition at line 1340 of file em_queue.c.

◆ queue_get_state_str()

const char* queue_get_state_str ( queue_state_t  state)

Get the string of a queue state

Definition at line 1673 of file em_queue.c.

◆ queue_get_type_str()

const char* queue_get_type_str ( em_queue_type_t  type)

Get the string of a queue type

Definition at line 1701 of file em_queue.c.

◆ queue_init()

em_status_t queue_init ( queue_tbl_t *const  queue_tbl,
queue_pool_t *const  queue_pool,
queue_pool_t *const  queue_pool_static 
)

Initialize the EM queues

Definition at line 217 of file em_queue.c.

◆ queue_init_local()

em_status_t queue_init_local ( void  )

Queue inits done during EM core local init (once at startup on each core).

Initialize event storage for queues of type 'EM_QUEUE_TYPE_LOCAL'.

Definition at line 303 of file em_queue.c.

◆ queue_setup_common()

void queue_setup_common ( queue_elem_t q_elem,
const queue_setup_t setup 
)

Helper function to queue_setup()

Set EM queue params common to all EM queues based on EM config

Definition at line 779 of file em_queue.c.

◆ queue_state_change()

em_status_t queue_state_change ( queue_elem_t *const  q_elem,
queue_state_t  new_state 
)

Change the queue state

Definition at line 1268 of file em_queue.c.

◆ queue_state_change__check()

em_status_t queue_state_change__check ( queue_state_t  old_state,
queue_state_t  new_state,
int  is_setup 
)

Helper func for queue_state_change() - check that state change is valid

Valid state transitions:

| |new-state|new-state |

old_state is_setup is_teardown
INVALID INIT (NULL)
INIT BIND INVALID
BIND READY INIT
READY (NULL) BIND

State change check is made easy because the following condition is true for valid state transitions: abs(old-new)=1

Definition at line 1230 of file em_queue.c.

◆ queue_state_change_all()

em_status_t queue_state_change_all ( eo_elem_t *const  eo_elem,
queue_state_t  new_state 
)

Change the queue state for all queues associated with the given EO

Definition at line 1282 of file em_queue.c.

◆ queue_term_local()

em_status_t queue_term_local ( void  )

Queue termination done during em_term_core().

Flush & destroy event storage for queues of type 'EM_QUEUE_TYPE_LOCAL'.

Definition at line 367 of file em_queue.c.