EM-ODP 4.4.0
Event Machine on ODP
Loading...
Searching...
No Matches
Queues

Data Structures

struct  em_queue_conf_t
 
struct  em_output_queue_conf_t
 
struct  em_queue_aggr_conf_t
 
struct  em_queue_param_t
 
struct  em_queue_aggr_info_t
 

Macros

#define PRI_QTYPE   PRIu32
 
#define PRI_QPRIO   PRIu32
 
#define EM_QUEUE_PRIO_UNDEF   0xFF
 
#define EM_QUEUE_FLAG_MASK   0x0000FFFF
 
#define EM_QUEUE_FLAG_DEFAULT   0
 
#define EM_QUEUE_FLAG_BLOCKING   0 /* blocking, fastest (default) */
 
#define EM_QUEUE_FLAG_NONBLOCKING_LF   1 /* non-blocking, lock-free */
 
#define EM_QUEUE_FLAG_NONBLOCKING_WF   2 /* non-blocking, wait-free */
 
#define EM_QUEUE_FLAG_ENQ_NOT_MTSAFE   4
 
#define EM_QUEUE_FLAG_DEQ_NOT_MTSAFE   8
 
#define em_queue_get_context   em_queue_context
 
#define em_queue_get_name   em_queue_name
 
#define em_queue_get_priority   em_queue_priority
 
#define em_queue_get_type   em_queue_type
 
#define em_queue_get_group   em_queue_qgroup
 
#define em_atomic_group_get   em_queue_agroup
 
#define em_queue_get_first   em_queue_first
 
#define em_queue_get_next   em_queue_next
 
#define em_queue_get_index   em_queue_index
 
#define em_queue_get_num_prio   em_queue_num_prio
 
#define em_queue_get_max_num   em_queue_max_num
 
#define em_queue_get_device_id   em_queue_device_id
 
#define em_queue_get_qid   em_queue_qid
 
#define em_queue_get_ids   em_queue_ids
 

Typedefs

typedef uint32_t em_queue_type_t
 
typedef enum em_queue_type_e em_queue_type_e
 
typedef uint32_t em_queue_prio_t
 
typedef enum em_queue_prio_e em_queue_prio_e
 
typedef uint32_t em_queue_flag_t
 
typedef int(* em_output_func_t) (const em_event_t events[], const unsigned int num, const em_queue_t output_queue, void *output_fn_args)
 

Enumerations

enum  em_queue_type_e {
  EM_QUEUE_TYPE_UNDEF = 0 , EM_QUEUE_TYPE_ATOMIC = 1 , EM_QUEUE_TYPE_PARALLEL = 2 , EM_QUEUE_TYPE_ORDERED = 3 ,
  EM_QUEUE_TYPE_PARALLEL_ORDERED = EM_QUEUE_TYPE_ORDERED , EM_QUEUE_TYPE_UNSCHEDULED = 4 , EM_QUEUE_TYPE_AGGR = 5 , EM_QUEUE_TYPE_LOCAL = 6 ,
  EM_QUEUE_TYPE_OUTPUT = 7
}
 
enum  em_queue_prio_e {
  EM_QUEUE_PRIO_LOWEST = 0 , EM_QUEUE_PRIO_LOW = 2 , EM_QUEUE_PRIO_NORMAL = 4 , EM_QUEUE_PRIO_HIGH = 6 ,
  EM_QUEUE_PRIO_HIGHEST = 7
}
 

Functions

em_queue_t em_queue_create (const char *name, em_queue_type_t type, em_queue_prio_t prio, em_queue_group_t group, const em_queue_conf_t *conf)
 
em_status_t em_queue_create_static (const char *name, em_queue_type_t type, em_queue_prio_t prio, em_queue_group_t group, em_queue_t queue, const em_queue_conf_t *conf)
 
void em_queue_aggr_conf_init (uint32_t num_aggr, em_queue_aggr_conf_t aggr_conf[])
 
void em_queue_param_init (em_queue_param_t *param)
 
em_queue_t em_queue_create_param (const char *name, const em_queue_param_t *param)
 
em_status_t em_queue_delete (em_queue_t queue)
 
em_status_t em_queue_set_context (em_queue_t queue, const void *context)
 
void * em_queue_context (em_queue_t queue)
 
size_t em_queue_name (em_queue_t queue, char *name, size_t maxlen)
 
em_queue_t em_queue_find (const char *name)
 
em_queue_prio_t em_queue_priority (em_queue_t queue)
 
em_queue_type_t em_queue_type (em_queue_t queue)
 
em_queue_t em_queue_static_handle (uint16_t static_offset)
 
em_queue_group_t em_queue_qgroup (em_queue_t queue)
 
em_atomic_group_t em_queue_agroup (em_queue_t queue)
 
em_event_t em_queue_dequeue (em_queue_t queue)
 
int em_queue_dequeue_multi (em_queue_t queue, em_event_t events[], int num)
 
em_queue_t em_queue_current (void)
 
em_queue_t em_queue_first (unsigned int *num)
 
em_queue_t em_queue_next (void)
 
int em_queue_index (em_queue_t queue)
 
int em_queue_num_prio (int *num_runtime)
 
int em_queue_max_num (void)
 
int em_queue_internal_max_num (void)
 
int em_queue_static_max_num (void)
 
int em_queue_dynamic_max_num (void)
 
int em_queue_aggr_max_num (void)
 
uint32_t em_queue_aggr_num (em_queue_t parent_queue)
 
em_queue_t em_queue_aggr (em_queue_t parent_queue, uint32_t aggr_index)
 
uint32_t em_queue_aggr_list (em_queue_t parent_queue, em_queue_t aggr_list[], uint32_t max, uint32_t *num_aggr)
 
uint32_t em_queue_aggr_info (em_queue_t parent_queue, em_queue_aggr_info_t aggr_info[], uint32_t max, uint32_t *num_aggr)
 
uint16_t em_queue_device_id (em_queue_t queue)
 
uint16_t em_queue_qid (em_queue_t queue)
 
void em_queue_ids (em_queue_t queue, uint16_t *device_id, uint16_t *qid)
 
em_queue_t em_queue_handle_raw (uint16_t device_id, uint16_t qid)
 
uint32_t em_queue_to_u32 (em_queue_t queue)
 

Detailed Description

Operations on queues

Queues are the communication mechanism used by EM. Each queue is associated with one Execution Object (EO) (or HW functionality), but each EO can have multiple queues.

A queue can have one of seven (7) different scheduling modes / queue types:

  1. EM_QUEUE_TYPE_ATOMIC
    • The atomic queue type limits event scheduling to one event at a time from the queue. The next event from the same queue can only be scheduled after the EO returns from processing the earlier event or calls em_atomic_processing_end() to signal end of atomic processing. This type is useful to avoid multicore race conditions as only one core at a time can be working on an event from an atomic queue. Additionally, the ingress-egress event order is maintained.

  1. EM_QUEUE_TYPE_PARALLEL
    • Parallel queues have no restriction for scheduling, which means that any amount of events (up to the number of cores in the queue group of the queue) can be processed simultaneously. This provides the best scaling, but race conditions need to be avoided and handled by the application.

  1. EM_QUEUE_TYPE_ORDERED
    • Ordered queues are scheduled like parallel queues — multiple events can be processed concurrently — but the system preserves egress ordering. This enables high single-flow throughput without requiring the application to synchronize for ordering between threads.

      Ordering context: When the scheduler dequeues an event (or burst) from an ordered queue, the receiving thread is associated with an ordering context that represents the event's sequence position in the queue. Contexts originating from the same ordered queue keep the mutual order of their corresponding events. The context is valid during the EO receive function and ends when the function returns, or earlier if em_ordered_processing_end() is called.

      Sending under an ordering context: Any event sent during the context inherits its sequence position, including events not received from the ordered queue (e.g. newly allocated or previously stored). The first event sent occupies the position of the received event; subsequent sends occupy the consecutive positions after it. The received event itself does not need to be forwarded; if no event is sent at all, the position is implicitly skipped.

      Destination queues: Events may be sent to any number of destination queues of any type. Ordering is enforced per destination queue (not between different destinations) and follows two rules:

      • Events sent by the same thread arrive in send-call order.
      • Events sent from different ordering contexts arrive in the order of those contexts. A chain of ordered (or atomic) queues preserves ordering end-to-end.

      Note that the guarantee covers enqueue, not processing: a non-atomic destination queue served by a multi-core EO may still process events out of order.

      Compared to atomic queues, which also maintain order, ordered queues achieve higher throughput by allowing multiple cores to process events in parallel.

  1. EM_QUEUE_TYPE_UNSCHEDULED
    • Unscheduled queues are not connected to the scheduler but instead the application needs to dequeue events directly using em_queue_dequeue(). The API function em_send() is used to enqueue events into an unscheduled queue. All queue types look the same to the sender with the exception that em_send_group() is not supported for unscheduled queues. Unscheduled queues cannot be added to an EO.

  1. EM_QUEUE_TYPE_AGGR
    • An aggregator queue is a child queue of a scheduled or unscheduled parent queue. Aggregator queues cannot be created/deleted directly but are created/deleted as part of the parent queue creation/deletion (see em_queue_param_t::num_aggr and em_queue_param_t::aggr_conf). Events sent to an aggregator queue may be bundled into vector events before being enqueued to the parent queue for delivery. Events can also be sent directly to the parent queue bypassing the aggregation. For unscheduled queues: the application must not dequeue from the aggregator queues directly, instead they should dequeue from the parent queue. For scheduled queues: the queue handle given to the EO receive function always corresponds to the parent scheduled queue, the aggregator queue handle is never passed. The application can send events to both the parent queue and the aggregator queues, depending on desired (vectorized/non-vectorized) behaviour.
      Note
      A vector event (major type EM_EVENT_TYPE_VECTOR) must never be sent to an aggregator queue - no vectors within vectors. A vector event may still be sent directly to the parent queue of the aggregators.
      Sending two events to separate aggregator queues of the same parent queue will not retain event order even if the parent queue would guarantee ordering.
  2. EM_QUEUE_TYPE_LOCAL
    • Local queues are special virtual queues bypassing the scheduler for fast core-local pipelining without load balancing or atomic processing. A local queue is connected (added) to an EO in the same way scheduled queues are. Events sent to a local queue are added to a per core (local) storage maintained by the EM dispatcher. This core local event storage is emptied by the dispatcher after the sending EO returns from the receive function. The local events are now immediately dispatched on the current core, i.e. handed to the receive function of the EO that owns the targeted local queue. Only when all local events have been handled is the scheduler allowed to schedule new events for the core. Local queues do not have an explicit ordered or atomic processing context, instead they inherit the context of the EO under which the event was sent (i.e. ordering could still be maintained with careful design). The sending EO's processing context is only released after the local queue is empty, unless the application explicitly ends the context earlier, thus effectively making local processing similar to handling the same function within the sending EO's receive. A local queue is not associated with a queue group and exists on all cores of the EM instance - the application must be able to handle events on all cores (unless sending to the local queue is controlled).

      The local queue concept is a performance optimization and a way to logically split processing into separate EO's but due to the side effects (may delay context release of the sending EO) and limitations should not be used without a valid reason. Local queues are mainly suitable for stateless processing that does not need EM scheduling.

  1. EM_QUEUE_TYPE_OUTPUT
    • An output queue is a system specific implementation of a SW-HW interface. It provides a queue interface for sending events out of EM to a HW device. It could e.g. be used for packet output or towards HW accelerators. The application uses em_send() to transmit an event for output. Typically the needed information to bind a queue to an interface is provided via the optional conf-argument given during queue creation (the content of 'conf' is system specific).

Currently EM does not define the exact queue behavior except that queues work like FIFOs. This means, e.g. that the maximum length of a queue is system specific (the conf parameter of queue create can be used to provide options)

Special queues towards asynchronous HW functions, e.g. a crypto accelerator, should look like any regular queue from the sender's point of view, i.e. em_send() and related functions work.

Macro Definition Documentation

◆ em_atomic_group_get

#define em_atomic_group_get   em_queue_agroup

Definition at line 1030 of file event_machine_queue.h.

◆ EM_QUEUE_FLAG_BLOCKING

#define EM_QUEUE_FLAG_BLOCKING   0 /* blocking, fastest (default) */

em_queue_flag_t value. Only combine flags with bitwise OR.

Blocking queue implementation. A suspending thread may block all other threads, i.e. no block freedom guarantees. Implied by EM_QUEUE_FLAG_DEFAULT for the implementation on this system.

Definition at line 341 of file event_machine_queue.h.

◆ EM_QUEUE_FLAG_DEFAULT

#define EM_QUEUE_FLAG_DEFAULT   0

em_queue_flag_t default value. The EM queues will use implementation specific default values. The default values for this implementation values imply: EM_QUEUE_FLAG_DEFAULT = MTSAFE and BLOCKING queue implementation

Examples
bench_event.c, event_group_abort.c, event_types.c, and queues_output.c.

Definition at line 330 of file event_machine_queue.h.

◆ EM_QUEUE_FLAG_DEQ_NOT_MTSAFE

#define EM_QUEUE_FLAG_DEQ_NOT_MTSAFE   8

em_queue_flag_t value. Only combine flags with bitwise OR.

Default multithread safe dequeue implementation not needed, the application guarantees there is no concurrent accesses in dequeue, i.e. em_queue_dequeue(). This can only be used with unscheduled queues and can potentially improve performance. The implementation may choose to ignore this flag. Use with care.

Examples
queues_unscheduled.c, and send_multi.c.

Definition at line 391 of file event_machine_queue.h.

◆ EM_QUEUE_FLAG_ENQ_NOT_MTSAFE

#define EM_QUEUE_FLAG_ENQ_NOT_MTSAFE   4

em_queue_flag_t value. Only combine flags with bitwise OR.

Default multithread safe enqueue implementation not needed, the application guarantees there is no concurrent accesses in enqueue, i.e. em_send(). This can only be used with unscheduled queues and can potentially improve performance. The implementation may choose to ignore this flag. Use with care.

Examples
queues_unscheduled.c, and send_multi.c.

Definition at line 378 of file event_machine_queue.h.

◆ EM_QUEUE_FLAG_MASK

#define EM_QUEUE_FLAG_MASK   0x0000FFFF

The low 16 bits are reserved for EM, the upper bits are free for system-specific use.

Definition at line 320 of file event_machine_queue.h.

◆ EM_QUEUE_FLAG_NONBLOCKING_LF

#define EM_QUEUE_FLAG_NONBLOCKING_LF   1 /* non-blocking, lock-free */

em_queue_flag_t value. Only combine flags with bitwise OR.

Require a non-blocking and lock-free queue implementation. Other threads can make progress while a thread is suspended. Starvation freedom is not guaranteed. Queue creation will fail if set and not supported.

Definition at line 353 of file event_machine_queue.h.

◆ EM_QUEUE_FLAG_NONBLOCKING_WF

#define EM_QUEUE_FLAG_NONBLOCKING_WF   2 /* non-blocking, wait-free */

em_queue_flag_t value. Only combine flags with bitwise OR.

Require a non-blocking and wait-free queue implementation. Other threads can make progress while a thread is suspended. Starvation freedom is guaranteed. Queue creation will fail if set and not supported.

Definition at line 365 of file event_machine_queue.h.

◆ em_queue_get_context

#define em_queue_get_context   em_queue_context

Definition at line 903 of file event_machine_queue.h.

◆ em_queue_get_device_id

#define em_queue_get_device_id   em_queue_device_id

Definition at line 1436 of file event_machine_queue.h.

◆ em_queue_get_first

#define em_queue_get_first   em_queue_first

Definition at line 1123 of file event_machine_queue.h.

◆ em_queue_get_group

#define em_queue_get_group   em_queue_qgroup

Definition at line 1013 of file event_machine_queue.h.

◆ em_queue_get_ids

#define em_queue_get_ids   em_queue_ids

Definition at line 1468 of file event_machine_queue.h.

◆ em_queue_get_index

#define em_queue_get_index   em_queue_index

Definition at line 1154 of file event_machine_queue.h.

◆ em_queue_get_max_num

#define em_queue_get_max_num   em_queue_max_num

Definition at line 1203 of file event_machine_queue.h.

◆ em_queue_get_name

#define em_queue_get_name   em_queue_name

Definition at line 927 of file event_machine_queue.h.

◆ em_queue_get_next

#define em_queue_get_next   em_queue_next

Definition at line 1138 of file event_machine_queue.h.

◆ em_queue_get_num_prio

#define em_queue_get_num_prio   em_queue_num_prio

Definition at line 1178 of file event_machine_queue.h.

◆ em_queue_get_priority

#define em_queue_get_priority   em_queue_priority

Definition at line 957 of file event_machine_queue.h.

◆ em_queue_get_qid

#define em_queue_get_qid   em_queue_qid

Definition at line 1450 of file event_machine_queue.h.

◆ em_queue_get_type

#define em_queue_get_type   em_queue_type

Definition at line 971 of file event_machine_queue.h.

◆ EM_QUEUE_PRIO_UNDEF

#define EM_QUEUE_PRIO_UNDEF   0xFF

Undefined

Examples
bench_event.c, event_types.c, queues_unscheduled.c, and send_multi.c.

Definition at line 301 of file event_machine_queue.h.

◆ PRI_QPRIO

#define PRI_QPRIO   PRIu32

Definition at line 281 of file event_machine_queue.h.

◆ PRI_QTYPE

#define PRI_QTYPE   PRIu32

em_queue_type_t printf format

Examples
queues_local.c.

Definition at line 206 of file event_machine_queue.h.

Typedef Documentation

◆ em_output_func_t

typedef int(* em_output_func_t) (const em_event_t events[], const unsigned int num, const em_queue_t output_queue, void *output_fn_args)

Output function, user provided callback for queues of type EM_QUEUE_TYPE_OUTPUT.

This function will be called by em_send*() when sending to a queue of type EM_QUEUE_TYPE_OUTPUT and EM will take care of correct function calling order based on the scheduling context type. The function can use em_sched_context_type_current() if it needs information about e.g. ordering requirements set by the parent scheduled queue.

Parameters
eventsList of events to be sent out (ptr to array of events)
numNumber of events (positive integer)
output_queueOutput queue that the events were sent to (em_send*())
output_fn_argsExtra arguments to indicate e.g. ordering requirement of the source context.
Returns
number of events successfully sent (equal to num if all successful)

Definition at line 441 of file event_machine_queue.h.

◆ em_queue_flag_t

typedef uint32_t em_queue_flag_t

Queue flags

An unsigned integer with defined queue flags that can be combined by bitwise 'OR' only. EM_QUEUE_FLAG_DEFAULT can be used in most cases. Unused bits must be set to zero. The actual values are system specific, but the implementation need to define at least: EM_QUEUE_FLAG_DEFAULT, EM_QUEUE_FLAG_BLOCKING, EM_QUEUE_FLAG_NONBLOCKING_LF and EM_QUEUE_FLAG_NONBLOCKING_WF even if those would not be supported.

Definition at line 313 of file event_machine_queue.h.

◆ em_queue_prio_e

Portable queue priorities.

These are generic portable values to use for priority with em_queue_prio_t.

Alternatively application may choose to use numeric values in the valid range (from 0 to em_queue_num_prio() - 1).

See also
em_queue_prio_t, em_queue_num_prio()

◆ em_queue_prio_t

Queue priority

Queue priority defines implementation specific QoS class for event scheduling. Priority is an integer in range 0 (lowest) to num priorities - 1. Note, that the exact scheduling rules are not defined by EM and all available priorities may not be relative to the adjacent one (e.g. using dynamic priority, rate limiting or other more complex scheduling discipline). There are 5 generic predefined values (em_queue_prio_e) mapped to available runtime priorities for portability.

See also
em_queue_create(), em_queue_num_prio(), em_queue_prio_e

Definition at line 280 of file event_machine_queue.h.

◆ em_queue_type_e

Queue types used by em_queue_type_t

◆ em_queue_type_t

Queue type.

Affects the scheduling principle

See also
em_queue_type_e, em_queue_create()

Definition at line 204 of file event_machine_queue.h.

Enumeration Type Documentation

◆ em_queue_prio_e

Portable queue priorities.

These are generic portable values to use for priority with em_queue_prio_t.

Alternatively application may choose to use numeric values in the valid range (from 0 to em_queue_num_prio() - 1).

See also
em_queue_prio_t, em_queue_num_prio()
Enumerator
EM_QUEUE_PRIO_LOWEST 

Lowest

EM_QUEUE_PRIO_LOW 

Low

EM_QUEUE_PRIO_NORMAL 

Normal

EM_QUEUE_PRIO_HIGH 

High

EM_QUEUE_PRIO_HIGHEST 

Highest

Definition at line 293 of file event_machine_queue.h.

◆ em_queue_type_e

Queue types used by em_queue_type_t

Enumerator
EM_QUEUE_TYPE_UNDEF 

Undefined

EM_QUEUE_TYPE_ATOMIC 

Atomic queue. The application receives events one by one, non-concurrently to guarantee exclusive processing and ordering

EM_QUEUE_TYPE_PARALLEL 

Parallel queue. The application may receive events fully concurrently, egress event ordering (when processed in parallel) not guaranteed

EM_QUEUE_TYPE_ORDERED 

Ordered parallel queue. The application may receive events concurrently, but the system takes care of egress order (between two queues)

EM_QUEUE_TYPE_PARALLEL_ORDERED 

backwards compatible alias

EM_QUEUE_TYPE_UNSCHEDULED 

A queue which is not connected to scheduling. The application needs to explicitly dequeue events

EM_QUEUE_TYPE_AGGR 

Aggregator queue. An aggregator queue is a child queue of a scheduled or unscheduled parent queue. Events sent to an aggregator queue are (possibly) bundled into vector events before being enqueued to the parent queue for delivery.

See also
Aggregator queues
EM_QUEUE_TYPE_LOCAL 

A queue type for local virtual queue not connected to scheduling.

EM_QUEUE_TYPE_OUTPUT 

A system specific queue type to abstract output from EM, e.g. packet output or output towards a HW accelerator. The application uses em_send() and variants to send an event 'out'.

Definition at line 211 of file event_machine_queue.h.

Function Documentation

◆ em_queue_aggr()

em_queue_t em_queue_aggr ( em_queue_t  parent_queue,
uint32_t  aggr_index 
)

Get an aggregator queue handle by index for the given parent queue.

The parent queue can be a scheduled or unscheduled queue, but not an aggregator queue itself. The returned aggregator queue is associated with the parent queue and can be used as destination queue for sending/enqueuing events. Events sent to this queue may be aggregated into vector events before being enqueued to the parent queue. The parent queue must have been configured with aggregator queues when created with em_queue_create_param() to get any aggregator queue returned by this function.

Parameters
parent_queueParent queue handle
aggr_indexAggregator queue index, range 0 to em_queue_aggr_num(parent_queue) - 1.
Returns
Aggregator queue handle or EM_QUEUE_UNDEF if not found.
Return values
EM_QUEUE_UNDEFInvalid 'parent_queue' (error reported).
EM_QUEUE_UNDEF'aggr_index' is out of range (no error).
See also
em_queue_create_param(), em_queue_aggr_conf_t, em_queue_aggr_num(), em_queue_aggr_info(), em_queue_aggr_list()

Definition at line 590 of file event_machine_queue.c.

◆ em_queue_aggr_conf_init()

void em_queue_aggr_conf_init ( uint32_t  num_aggr,
em_queue_aggr_conf_t  aggr_conf[] 
)

Initialize configuration parameters for aggregator queue(s).

Initialize an array of em_queue_aggr_conf_t:s to default values. Always call this before setting fields to ensure compatibility with potentially added new options. EM will enforce this and report an error if not done.

Parameters
num_aggrNumber of elements in aggr_conf[] (1..EM_QUEUE_MAX_AGGR)
aggr_confAddress of the em_queue_aggr_conf_t array to initialize
See also
em_queue_aggr_conf_t, em_queue_create_param()

Definition at line 153 of file event_machine_queue.c.

◆ em_queue_aggr_info()

uint32_t em_queue_aggr_info ( em_queue_t  parent_queue,
em_queue_aggr_info_t  aggr_info[],
uint32_t  max,
uint32_t *  num_aggr 
)

Get aggregator queue information for the given parent queue.

Returns information about the aggregator queues configured for the given parent queue. Each element in the output array 'aggr_info[]' contains the aggregator queue handle and the configuration that was used when the parent queue was created.

The parent queue can be a scheduled or unscheduled queue, but not an aggregator queue itself.

This is a heavier operation than em_queue_aggr() and em_queue_aggr_list() and should only be used when the additional information about the aggregator queues is needed.

uint32_t num_aggr = 0;
uint32_t num = em_queue_aggr_info(parent_queue, info,
EM_QUEUE_MAX_AGGR, &num_aggr);
for (uint32_t i = 0; i < num; i++)
use_aggr(info[i].queue, info[i].pool, ...);
#define EM_QUEUE_MAX_AGGR
uint32_t em_queue_aggr_info(em_queue_t parent_queue, em_queue_aggr_info_t aggr_info[], uint32_t max, uint32_t *num_aggr)
Parameters
parent_queueParent queue handle
[out]aggr_infoArray for aggregator queue information output, must have room for 'max' entries. Use NULL if only interested in 'num_aggr'.
maxMaximum number of entries to write into 'aggr_info[]', ignored if 'aggr_info' is NULL. 'max' is in the range 0 .. EM_QUEUE_MAX_AGGR.
[out]num_aggrOutput for the total number of configured aggregator queues for 'parent_queue'. Optional, can be NULL if not needed.
Returns
Number of entries written into 'aggr_info[]' (in the range 0 to min(num_aggr, max)), or 0 on error.
See also
em_queue_create_param(), em_queue_aggr_conf_t, em_queue_aggr_num(), em_queue_aggr(), em_queue_aggr_list()

Definition at line 641 of file event_machine_queue.c.

◆ em_queue_aggr_list()

uint32_t em_queue_aggr_list ( em_queue_t  parent_queue,
em_queue_t  aggr_list[],
uint32_t  max,
uint32_t *  num_aggr 
)

Get aggregator queue handles for a given parent queue.

This function outputs the total number of aggregator queues configured for the given parent queue via the output parameter 'num_aggr' and writes queue handles to 'aggr_list[]' up to the given 'max' length (<= EM_QUEUE_MAX_AGGR).

The parent queue can be a scheduled or unscheduled queue, but not an aggregator queue itself. The returned aggregator queues are associated with the parent queue and can be used as destination queues for sending/enqueuing events. Events sent to these queues may be aggregated into vector events before being enqueued to the parent queue. The parent queue must have been configured with aggregator queues when created with em_queue_create_param() to get any aggregator queues returned by this function.

To only get the number of aggregator queues without retrieving handles:

uint32_t num_aggr = 0;
(void)em_queue_aggr_list(parent_queue, NULL, 0, &num_aggr);
uint32_t em_queue_aggr_list(em_queue_t parent_queue, em_queue_t aggr_list[], uint32_t max, uint32_t *num_aggr)

To get all aggregator queue handles for a parent queue:

em_queue_t aggr_list[EM_QUEUE_MAX_AGGR];
uint32_t num_aggr = 0;
uint32_t num_out = em_queue_aggr_list(parent_queue, aggr_list,
EM_QUEUE_MAX_AGGR, &num_aggr);
for (uint32_t i = 0; i < num_out; i++)
use_aggr(aggr_list[i]);
Parameters
parent_queueParent queue handle for which to list the aggregator queues.
[out]aggr_listPointer to an aggregator queue handle array that can fit 'max' amount of handles. Use NULL if only interested in 'num_aggr'.
maxMax number of handles that can be written into 'aggr_list[]', ignored if 'aggr_list' is NULL. 'max' is in the range 0 .. EM_QUEUE_MAX_AGGR. 'max' is capped to EM_QUEUE_MAX_AGGR if greater.
[out]num_aggrOutput for the total number of configured aggregator queues for 'parent_queue'. Optional, can be NULL if not needed.
Returns
Number of handles written into 'aggr_list[]' (in the range 0 to min(num_aggr, max)).
See also
em_queue_create_param(), em_queue_aggr_conf_t

Definition at line 608 of file event_machine_queue.c.

◆ em_queue_aggr_max_num()

int em_queue_aggr_max_num ( void  )

Get the maximum number of EM aggregator queues that can be created.

The maximum number of aggregator queues that can be created is configured via 'queue.num_aggr' in em-odp.conf.

Returns
The maximum number of aggregator queues that can be created over all parent (scheduled and unscheduled) queues in the EM instance.
See also
em_queue_max_num(), em_queue_internal_max_num(), em_queue_static_max_num(), em_queue_dynamic_max_num()

Definition at line 568 of file event_machine_queue.c.

◆ em_queue_aggr_num()

uint32_t em_queue_aggr_num ( em_queue_t  parent_queue)

Get the number of aggregator queues for the given parent queue.

The parent queue can be a scheduled or unscheduled queue, but not an aggregator queue itself.

Parameters
parent_queueParent queue handle
Returns
Number of aggregator queues configured for 'parent_queue', or 0 if no aggregator queues are configured (or on an error).
See also
em_queue_aggr(), em_queue_aggr_info(), em_queue_aggr_list()

Definition at line 573 of file event_machine_queue.c.

◆ em_queue_agroup()

em_atomic_group_t em_queue_agroup ( em_queue_t  queue)

Get the associated atomic group (if any) of the given queue.

Returns the atomic group of the given queue.

Parameters
queueQueue handle
Returns
The atomic group the queue belongs to or EM_ATOMIC_GROUP_UNDEF if the given queue is not valid or doesn't belong to an atomic group.
See also
em_atomic_group_create()

Definition at line 367 of file event_machine_queue.c.

◆ em_queue_context()

void * em_queue_context ( em_queue_t  queue)

Get queue specific (application) context.

Returns the value application has earlier set with em_queue_set_context().

Parameters
queueQueue for which the context is requested
Returns
Queue specific context pointer or NULL on error.
See also
em_queue_set_context()
Examples
queue_types_local.c, queues_unscheduled.c, and send_multi.c.

Definition at line 240 of file event_machine_queue.c.

◆ em_queue_create()

em_queue_t em_queue_create ( const char *  name,
em_queue_type_t  type,
em_queue_prio_t  prio,
em_queue_group_t  group,
const em_queue_conf_t conf 
)

Create a new queue with a dynamic queue handle (i.e. handle given by EM)

The given name string is copied into an EM internal data structure. The maximum string length is EM_QUEUE_NAME_LEN.

Create scheduled atomic, parallel or ordered queues by using the types EM_QUEUE_TYPE_ATOMIC, EM_QUEUE_TYPE_PARALLEL or EM_QUEUE_TYPE_ORDERED.

To create an unscheduled queue, use the type EM_QUEUE_TYPE_UNSCHEDULED. The prio and queue group are not relevant, but need to be set to EM_QUEUE_PRIO_UNDEF and EM_QUEUE_GROUP_UNDEF. Unscheduled queues can't be associated with an EO (em_eo_add_queue() fails).

To create a local queue, use type EM_QUEUE_TYPE_LOCAL. The queue group is not relevant and must be set to EM_QUEUE_GROUP_UNDEF. The virtual local queue is created for all cores in this EM instance. Note also that the implementation may not implement priorities for local queues.

To create an output queue, use the type EM_QUEUE_TYPE_OUTPUT. Pass the needed information to bind a queue with an interface via the conf-argument (content is system and output-type specific). The queue group is not relevant and must be set to EM_QUEUE_GROUP_UNDEF. Note also that the implementation may not implement priorities for output queues.

The 'conf' argument is optional and can be used to pass extra attributes (e.g. require non-blocking behaviour, if supported) to the system specific implementation.

Parameters
nameQueue name (optional, NULL ok)
typeQueue type
prioQueue priority class
groupQueue group for this queue
confOptional configuration data, NULL for defaults
Returns
New queue handle or EM_QUEUE_UNDEF on an error.
See also
em_queue_group_create(), em_queue_delete(), em_queue_conf_t
Examples
api_hooks.c, atomic_processing_end.c, bench_event.c, cli_top.c, dispatcher_callback.c, dyn_cores.c, error.c, event_group.c, event_group_abort.c, event_group_assign_end.c, event_group_chaining.c, event_types.c, fractal.c, hello.c, loop_united.c, ordered.c, pool_perf.c, queue_group.c, queue_groups.c, queue_types_ag.c, queue_types_local.c, queues.c, queues_local.c, queues_output.c, queues_unscheduled.c, scheduling_latency.c, send_multi.c, timer_hello.c, timer_test.c, timer_test_periodic.c, and timer_test_ring.c.

Definition at line 67 of file event_machine_queue.c.

◆ em_queue_create_param()

em_queue_t em_queue_create_param ( const char *  name,
const em_queue_param_t param 
)

Create a new EM queue according to the given parameters.

The queue name is copied into queue internal data. The maximum length stored is EM_QUEUE_NAME_LEN. Duplicate names are allowed, but find will only match one of them.

Always initialize 'param' first with em_queue_param_init(&param) to ensure backwards compatibility and default values for all fields before setting your own params and calling em_queue_create_param():

em_queue_t queue;
em_queue_param_init(&param); - Set default values for all fields
param.queue = EM_QUEUE_UNDEF; - Request a dynamic queue
...
queue = em_queue_create_param("my-queue", &param);
if (unlikely(queue == EM_QUEUE_UNDEF))
report_error();
#define EM_QUEUE_UNDEF
void em_queue_param_init(em_queue_param_t *param)
em_queue_t em_queue_create_param(const char *name, const em_queue_param_t *param)
@ EM_QUEUE_TYPE_ATOMIC
@ EM_QUEUE_PRIO_NORMAL
Parameters
nameName of the queue (optional, NULL ok)
paramQueue parameters
Returns
New queue handle if successful, otherwise EM_QUEUE_UNDEF.
Return values
EM_QUEUE_UNDEFon error

Definition at line 190 of file event_machine_queue.c.

◆ em_queue_create_static()

em_status_t em_queue_create_static ( const char *  name,
em_queue_type_t  type,
em_queue_prio_t  prio,
em_queue_group_t  group,
em_queue_t  queue,
const em_queue_conf_t conf 
)

Create a new queue with a static queue handle (i.e. given by the user).

Note that the number of static queues is provided by the user through 'queue.num_static' in em-odp.conf at runtime. A valid static queue handle can be derived as follows:

em_status_t status;
em_queue_t static_queue = em_queue_static_handle(x);
static_queue, conf);
#define EM_QUEUE_GROUP_DEFAULT
uint32_t em_status_t
em_queue_t em_queue_static_handle(uint16_t static_offset)
em_status_t em_queue_create_static(const char *name, em_queue_type_t type, em_queue_prio_t prio, em_queue_group_t group, em_queue_t queue, const em_queue_conf_t *conf)

The 'x' in above pseudocode must be in range 0 to 'queue.num_static' - 1.

Otherwise like em_queue_create().

Parameters
nameQueue name (optional, NULL ok)
typeQueue scheduling type
prioQueue priority
groupQueue group for this queue
queueRequested queue handle from the static range
confOptional configuration data, NULL for defaults
Returns
EM_OK if successful.
See also
em_queue_create(), em_queue_static_handle()

Definition at line 95 of file event_machine_queue.c.

◆ em_queue_current()

em_queue_t em_queue_current ( void  )

Returns the current active queue

The 'current active queue' is the queue that delivered the input event to the EO-receive that is currently being run.

Only valid if called within an EO-receive context, will return EM_QUEUE_UNDEF otherwise, i.e. can be called from the EO-receive functions or subfunctions thereof. Note that calling em_queue_current() from an EO-start/stop function that was launched from within an EO's receive function will return EM_QUEUE_UNDEF.

Returns
The current queue or EM_QUEUE_UNDEF if no current queue (or error)
Examples
api_hooks.c, queue_types_ag.c, and queue_types_local.c.

Definition at line 454 of file event_machine_queue.c.

◆ em_queue_delete()

em_status_t em_queue_delete ( em_queue_t  queue)

Delete a queue.

Unallocates the queue handle. This is an immediate deletion and can only be done after the queue has been removed from scheduling using em_eo_remove_queue().

Parameters
queueQueue handle to delete
Returns
EM_OK if successful.
See also
em_eo_remove_queue(), em_queue_create(), em_queue_create_static()
Examples
api_hooks.c, bench_event.c, dispatcher_callback.c, dyn_cores.c, event_types.c, hello.c, queue_group.c, queue_groups.c, queues.c, queues_local.c, queues_output.c, queues_unscheduled.c, and send_multi.c.

Definition at line 208 of file event_machine_queue.c.

◆ em_queue_dequeue()

em_event_t em_queue_dequeue ( em_queue_t  queue)

Dequeue an event from an unscheduled queue

This can only be used with unscheduled queues created with the type EM_QUEUE_TYPE_UNSCHEDULED. Events are added to these queues with em_send(), similar to queues of other types, but applications needs to explicitly dequeue the event(s). Unscheduled queues are general purpose FIFOs, i.e. send(enqueue) to tail and dequeue from head. The maximum length of an unscheduled queue is system specific.

An unscheduled queue can also have a context, but if used it needs to be asked separately using em_queue_context().

Parameters
queueUnscheduled queue handle
Returns
Event from head of queue or EM_EVENT_UNDEF if there was no events or an error occurred.
Examples
bench_event.c, event_types.c, queues_unscheduled.c, and send_multi.c.

Definition at line 384 of file event_machine_queue.c.

◆ em_queue_dequeue_multi()

int em_queue_dequeue_multi ( em_queue_t  queue,
em_event_t  events[],
int  num 
)

Dequeue multiple events from an unscheduled queue

This can only be used with unscheduled queues created with the type EM_QUEUE_TYPE_UNSCHEDULED. Events are added to these queues with em_send(), similar to queues of other types, but applications needs to explicitly dequeue the event(s). Unscheduled queues are general purpose FIFOs, i.e. send(enqueue) to tail and dequeue from head. The maximum length of an unscheduled queue is system specific.

An unscheduled queue can also have a context, but needs to be asked separately using em_queue_context().

Parameters
queueUnscheduled queue handle
[out]eventsArray of event handles for output
numMaximum number of events to dequeue
Returns
Number of successfully dequeued events (0 to num)
Examples
bench_event.c, and send_multi.c.

Definition at line 412 of file event_machine_queue.c.

◆ em_queue_device_id()

uint16_t em_queue_device_id ( em_queue_t  queue)

Returns the device-id extracted from the given queue handle

An EM queue handle consists of a device-id and a queue-id. This function extracts the device-id from an EM queue handle and returns it.

Parameters
queueEM queue handle
Returns
the device-id extracted from the queue handle

Definition at line 701 of file event_machine_queue.c.

◆ em_queue_dynamic_max_num()

int em_queue_dynamic_max_num ( void  )

Get the maximum number of EM dynamic queues that can be created.

The maximum number of dynamic queues that can be created is configured via 'queue.num_dynamic' in em-odp.conf.

Returns
The maximum number of dynamic queues that can be created in the EM instance.
See also
em_queue_max_num(), em_queue_internal_max_num(), em_queue_static_max_num(), em_queue_aggr_max_num()

Definition at line 563 of file event_machine_queue.c.

◆ em_queue_find()

em_queue_t em_queue_find ( const char *  name)

Find a queue by name.

Finds a queue by the given name (exact match). An empty string will not match anything. The search is case sensitive. The function will return the first match only if there are duplicate names, Be aware of that the search may take a long time if there are many queues.

Parameters
namename to look for
Returns
queue handle or EM_QUEUE_UNDEF if not found
See also
em_queue_create()
Examples
queue_types_ag.c.

Definition at line 283 of file event_machine_queue.c.

◆ em_queue_first()

em_queue_t em_queue_first ( unsigned int *  num)

Initialize queue iteration and return the first queue handle.

Can be used to initialize the iteration to retrieve all created queues for debugging or management purposes. Use em_queue_next() after this call until it returns EM_QUEUE_UNDEF. A new call to em_queue_first() resets the iteration, which is maintained per core (thread). The operation should be completed in one go before returning from the EO's event receive function (or start/stop).

The number of queues (output arg 'num') may not match the amount of queues actually returned by iterating using em_queue_next() if queues are added or removed in parallel by another core. The order of the returned queue handles is undefined.

unsigned int num;
em_queue_t q = em_queue_first(&num);
while (q != EM_QUEUE_UNDEF) {
}
em_queue_t em_queue_first(unsigned int *num)
em_queue_t em_queue_next(void)
Parameters
[out]numPointer to an unsigned int to store the amount of queues into
Returns
The first queue handle or EM_QUEUE_UNDEF if none exist
See also
em_queue_next()
Examples
queue_types_ag.c.

Definition at line 459 of file event_machine_queue.c.

◆ em_queue_handle_raw()

em_queue_t em_queue_handle_raw ( uint16_t  device_id,
uint16_t  qid 
)

Construct a raw EM queue handle from the provided device-id and queue-id.

An EM queue handle consists of a device-id and a queue-id. This function constructs an EM queue handle by combining the device-id and queue-id together into an EM queue handle.

Note
No checks for the validity of the provided device-id or queue-id are done. Thus the constructed EM queue handle is a raw value that may not refer to any existing queue on this EM instance or on another. Be careful.
Parameters
device_id
qid
Returns
raw EM queue handle created from the given arguments

Definition at line 725 of file event_machine_queue.c.

◆ em_queue_ids()

void em_queue_ids ( em_queue_t  queue,
uint16_t *  device_id,
uint16_t *  qid 
)

Extract and output both the device-id and the queue-id from the given queue handle.

An EM queue handle consists of a device-id and a queue-id. This function extracts both the device-id and the queue-id from an EM queue handle and returns them to the caller via the output arguments 'device_id' and 'qid'.

Parameters
queueEM queue handle
[out]device_iddevice-id
[out]qidqueue-id

Definition at line 715 of file event_machine_queue.c.

◆ em_queue_index()

int em_queue_index ( em_queue_t  queue)

Get a unique index corresponding to the given EM queue handle.

Returns a unique index in the range 0 to em_queue_max_num() - 1. The same EM queue handle will always map to the same index.

Only meaningful for queues created within the current EM instance.

Parameters
queueEM queue handle
Returns
Index in the range 0 to em_queue_max_num() - 1

Definition at line 506 of file event_machine_queue.c.

◆ em_queue_internal_max_num()

int em_queue_internal_max_num ( void  )

Get the maximum number of EM internal queues that EM might internally create.

EM reserves a number of internal queues for its own use (core-local and shared internal queues) - this function returns that number. Note that this is a maximum number and that the actual number of internal queues may be less depending on the EM configuration and runtime environment.

Returns
the maximum number of internal queues reserved by EM
See also
em_queue_max_num()

Definition at line 553 of file event_machine_queue.c.

◆ em_queue_max_num()

int em_queue_max_num ( void  )

Returns the maximum number of EM queues that can be created.

The maximum number of EM queues contains all EM queues (static and dynamic) created by the application as well as the internal EM queues. The number of static and dynamic queues can be configured via 'queue.num_static' and 'queue.num_dynamic' in em-odp.conf.

Note that the function returns the maximum number of queues that can be created, not the actual number of queues currently created nor the max number of queues that has been created at any point in time in the EM instance. The actual number of queues currently created can be obtained by calling em_queue_first(&num).

Returns
the maximum number of EM queues of any type that can be created in the EM instance
See also
em_queue_internal_max_num(), em_queue_static_max_num(), em_queue_dynamic_max_num()

Definition at line 548 of file event_machine_queue.c.

◆ em_queue_name()

size_t em_queue_name ( em_queue_t  queue,
char *  name,
size_t  maxlen 
)

Get the queue name.

Returns the name given to a queue when it was created. A copy of the queue name string (up to 'maxlen' characters) is written to the user given buffer. The string is always null terminated even if the given buffer length is less than the name length.

The function returns '0' and writes an empty string if the queue has no name.

Parameters
queueQueue handle
[out]nameDestination buffer
maxlenMaximum length (including the terminating '0')
Returns
Number of characters written (excludes the terminating '0').
See also
em_queue_create()
Examples
atomic_processing_end.c, and queue_types_ag.c.

Definition at line 259 of file event_machine_queue.c.

◆ em_queue_next()

em_queue_t em_queue_next ( void  )

Return the next queue handle.

Continues the queue iteration started by em_queue_first() and returns the next queue handle.

Returns
The next queue handle or EM_QUEUE_UNDEF if the queue iteration is completed (i.e. no more queues available).
See also
em_queue_first()
Examples
queue_types_ag.c.

Definition at line 485 of file event_machine_queue.c.

◆ em_queue_num_prio()

int em_queue_num_prio ( int *  num_runtime)

Returns the number of queue priorities available.

Optionally the amount of actual runtime priorities can be inquired. Valid queue priority range is from 0 (lowest priority) to em_queue_num_prio() - 1.

Runtime environment may provide different amount of levels. In that case EM priorities are mapped to the runtime values depending on mapping mode selected in the runtime configuration file.

Parameters
[out]num_runtimePointer to an int to receive the number of actual runtime priorities. Set to NULL if not needed.
Returns
number of queue priorities
See also
em-odp.conf

Definition at line 535 of file event_machine_queue.c.

◆ em_queue_param_init()

void em_queue_param_init ( em_queue_param_t param)

Initialize parameters for EM queue creation.

Initialize em_queue_param_t to default values for all fields. After initialization, the user further needs to set the mandatory fields of 'em_queue_param_t' before calling em_queue_create_param(). Always initialize 'param' first with em_queue_param_init(&param) to ensure backwards compatibility with potentially added new options. EM will enforce this initialization and report an error if not done.

Parameters
paramAddress of the em_queue_param_t to be initialized
See also
em_queue_create_param()

Definition at line 172 of file event_machine_queue.c.

◆ em_queue_priority()

em_queue_prio_t em_queue_priority ( em_queue_t  queue)

Get the queue priority.

Parameters
queueQueue handle
Returns
Priority class or EM_QUEUE_PRIO_UNDEF on an error.
See also
em_queue_create()

Definition at line 301 of file event_machine_queue.c.

◆ em_queue_qgroup()

em_queue_group_t em_queue_qgroup ( em_queue_t  queue)

Get the associated queue group of the given queue.

Parameters
queueQueue handle
Returns
Queue group or EM_QUEUE_GROUP_UNDEF on error.
See also
em_queue_create(), em_queue_group_create(), em_queue_group_modify()
Examples
queue_group.c.

Definition at line 350 of file event_machine_queue.c.

◆ em_queue_qid()

uint16_t em_queue_qid ( em_queue_t  queue)

Returns the queue-id extracted from the given queue handle

An EM queue handle consists of a device-id and a queue-id. This function extracts the queue-id from an EM queue handle and returns it.

Parameters
queueEM queue handle
Returns
the queue-id extracted from the queue handle

Definition at line 708 of file event_machine_queue.c.

◆ em_queue_set_context()

em_status_t em_queue_set_context ( em_queue_t  queue,
const void *  context 
)

Set queue specific (application) context.

This is a single pointer associated with a queue. The application can use it to access some context data quickly (without a lookup). The context is given as an argument to the EO receive function. EM does not dereference it.

Parameters
queueQueue to which associate the context
contextContext pointer
Returns
EM_OK if successful.
See also
em_receive_func_t(), em_queue_context()
Examples
api_hooks.c, dispatcher_callback.c, fractal.c, hello.c, loop_united.c, ordered.c, queue_group.c, queue_groups.c, queue_types_ag.c, queue_types_local.c, queues.c, queues_local.c, queues_output.c, queues_unscheduled.c, and send_multi.c.

Definition at line 226 of file event_machine_queue.c.

◆ em_queue_static_handle()

em_queue_t em_queue_static_handle ( uint16_t  static_offset)

Construct a static queue handle from a given static offset.

The first static queue handle is em_queue_static_handle(0), and the last one is em_queue_static_handle(em_queue_static_max_num() - 1). The static offset must be in range 0 .. em_queue_static_max_num() - 1, otherwise EM_QUEUE_UNDEF is returned.

Use the constructed handle with em_queue_create_static() to create the corresponding queue if it has not been created already.

Parameters
static_offsetoffset from the first static queue ID. Must be in range 0 to em_queue_static_max_num() - 1
Note
The device id is not affected by this function and remains the same as in the first static queue handle. More specifically, the same device id as this EM instance is used.
This function only constructs a static queue handle based on the provided offset. It does not verify whether the corresponding static queue has been created. The returned value is a handle, which may or may not refer to an existing queue.
Returns
A valid static queue handle or EM_QUEUE_UNDEF on error.
See also
em_queue_create_static(), em_queue_static_max_num()

Definition at line 329 of file event_machine_queue.c.

◆ em_queue_static_max_num()

int em_queue_static_max_num ( void  )

Get the maximum number of EM static queues that can be created.

The maximum number of EM static queues that can be created are configured via 'queue.num_static' in em-odp.conf.

Returns
Number of static queues configured, or 0 if none configured
See also
em_queue_max_num(), em_queue_internal_max_num(), em_queue_dynamic_max_num(), em_queue_aggr_max_num()

Definition at line 558 of file event_machine_queue.c.

◆ em_queue_to_u32()

uint32_t em_queue_to_u32 ( em_queue_t  queue)

Convert an queue handle to an unsigned integer

Parameters
queuequeue handle to be converted
Returns
uint32_t value that can be used to print/display the handle
Note
This routine is intended to be used for diagnostic purposes to enable applications to e.g. generate a printable value that represents an em_queue_t handle.
Unlike other "EM handle to unsigned integer" conversion functions, the queue handle is converted to a uint32_t (instead of a uint64_t) since the handle consists of a 16-bit device-id and a 16-bit queue-id.

Definition at line 732 of file event_machine_queue.c.

◆ em_queue_type()

em_queue_type_t em_queue_type ( em_queue_t  queue)

Get the queue type.

Parameters
queueQueue handle
Returns
Queue type or EM_QUEUE_TYPE_UNDEF on an error.
See also
em_queue_create()
Examples
queue_types_ag.c.

Definition at line 315 of file event_machine_queue.c.