UCX
1.5
Unified Communication X
|
Data Structures | |
struct | ucs_sock_addr |
Typedefs | |
typedef void(* | ucs_async_event_cb_t) (int id, void *arg) |
typedef struct ucs_sock_addr | ucs_sock_addr_t |
typedef unsigned long | ucs_time_t |
typedef void * | ucs_status_ptr_t |
Status pointer. More... | |
Functions | |
ucs_status_t | ucs_async_set_event_handler (ucs_async_mode_t mode, int event_fd, int events, ucs_async_event_cb_t cb, void *arg, ucs_async_context_t *async) |
ucs_status_t | ucs_async_add_timer (ucs_async_mode_t mode, ucs_time_t interval, ucs_async_event_cb_t cb, void *arg, ucs_async_context_t *async, int *timer_id_p) |
ucs_status_t | ucs_async_remove_handler (int id, int sync) |
ucs_status_t | ucs_async_modify_handler (int fd, int events) |
ucs_status_t | ucs_async_context_create (ucs_async_mode_t mode, ucs_async_context_t **async_p) |
Create an asynchronous execution context. More... | |
void | ucs_async_context_destroy (ucs_async_context_t *async) |
Destroy the asynchronous execution context. More... | |
void | ucs_async_poll (ucs_async_context_t *async) |
This section describes a concept of the Communication Resource and routines associated with the concept.
struct ucs_sock_addr |
typedef void(* ucs_async_event_cb_t) (int id, void *arg) |
Async event callback.
id | Event id (timer or file descriptor). |
arg | User-defined argument. |
typedef struct ucs_sock_addr ucs_sock_addr_t |
BSD socket address specification.
typedef unsigned long ucs_time_t |
Copyright (C) Mellanox Technologies Ltd. 2001-2017. ALL RIGHTS RESERVED.
See file LICENSE for terms.
UCS time units. These are not necessarily aligned with metric time units. MUST compare short time values with UCS_SHORT_TIME_CMP to handle wrap-around.
typedef void* ucs_status_ptr_t |
A pointer can represent one of these values:
enum ucs_callbackq_flags |
enum ucs_status_t |
enum ucs_thread_mode_t |
Specifies thread sharing mode of an object.
ucs_status_t ucs_async_set_event_handler | ( | ucs_async_mode_t | mode, |
int | event_fd, | ||
int | events, | ||
ucs_async_event_cb_t | cb, | ||
void * | arg, | ||
ucs_async_context_t * | async | ||
) |
Register a file descriptor for monitoring (call handler upon events). Every fd can have only one handler.
mode | Thread or signal. |
event_fd | File descriptor to set handler for. |
events | Events to wait on (POLLxx/EPOLLxx bits). |
cb | Callback function to execute. |
arg | Argument to callback. |
async | Async context to which events are delivered. If NULL, safety is up to the user. |
ucs_status_t ucs_async_add_timer | ( | ucs_async_mode_t | mode, |
ucs_time_t | interval, | ||
ucs_async_event_cb_t | cb, | ||
void * | arg, | ||
ucs_async_context_t * | async, | ||
int * | timer_id_p | ||
) |
Add timer handler.
mode | Thread or signal. |
interval | Timer interval. |
cb | Callback function to execute. |
arg | Argument to callback. |
async | Async context to which events are delivered. If NULL, safety is up to the user. |
timer_id_p | Filled with timer id. |
ucs_status_t ucs_async_remove_handler | ( | int | id, |
int | sync | ||
) |
Remove an event handler (Timer or event file).
id | Timer/FD to remove. |
sync | If nonzero, wait until the handler for this event is not running anymore. Cannot be used in the context of the event handler itself because it would deadlock. |
ucs_status_t ucs_async_modify_handler | ( | int | fd, |
int | events | ||
) |
Modify events mask for an existing event handler (event file).
fd | File descriptor modify events for. |
events | New set of events to wait on (POLLxx/EPOLLxx bits). |
ucs_status_t ucs_async_context_create | ( | ucs_async_mode_t | mode, |
ucs_async_context_t ** | async_p | ||
) |
Allocate and initialize an asynchronous execution context. This can be used to ensure safe event delivery.
mode | Either to use signals or epoll threads to wait. |
async_p | Event context pointer to initialize. |
void ucs_async_context_destroy | ( | ucs_async_context_t * | async | ) |
Clean up the async context, and release system resources if possible. The context memory released.
async | Asynchronous context to clean up. |
void ucs_async_poll | ( | ucs_async_context_t * | async | ) |
Poll on async context.
async | Async context to poll on. NULL polls on all. |