![]() |
UCX
1.18
Unified Communication X
|
Data Structures | |
struct | ucs_sock_addr |
Typedefs | |
typedef void(* | ucs_async_event_cb_t) (int id, ucs_event_set_types_t events, void *arg) |
typedef struct ucs_sock_addr | ucs_sock_addr_t |
typedef enum ucs_memory_type | ucs_memory_type_t |
Memory types. More... | |
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, ucs_event_set_types_t 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, ucs_event_set_types_t 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, ucs_event_set_types_t events, void *arg) |
Async event callback.
id | Event id (timer or file descriptor). |
events | The events that triggered the callback. |
arg | User-defined argument. |
typedef struct ucs_sock_addr ucs_sock_addr_t |
BSD socket address specification.
typedef enum ucs_memory_type ucs_memory_type_t |
List of supported memory types.
typedef unsigned long ucs_time_t |
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_memory_type |
List of supported memory types.
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, | ||
ucs_event_set_types_t | 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 (UCS_EVENT_SET_EVxxx 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. If called from the context of the callback, the handler will be removed immediately after the current callback returns. |
ucs_status_t ucs_async_modify_handler | ( | int | fd, |
ucs_event_set_types_t | 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 (UCS_EVENT_SET_EVxxx 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 | Indicates whether to use signals or polling threads for waiting. |
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. |