Functions for networking, I/O and multithreading.
dap_events.h dap_events.c
General management of the I/O event reactor.
dap_events_init
int dap_events_init( uint32_t a_threads_count, size_t a_conn_timeout);
Initialization of the I/O reactor server module.
dap_events_deinit
void dap_events_deinit();
Deinitialization of the I/O reactor server module.
dap_events_new
dap_events_t* dap_events_new();
Create a new dap_events_t
object.
dap_events_get_default
dap_events_t* dap_events_get_default();
Get the default dap_events_t
object.
dap_events_delete
void dap_events_delete( dap_events_t * a_events );
Removing the dap_events_t
object.
dap_events_start
int32_t dap_events_start( dap_events_t *a_events );
Launching worker threads.
dap_events_stop_all
void dap_events_stop_all();
Terminating worker threads.
dap_events_wait
int32_t dap_events_wait( dap_events_t *a_events );
Stops the current thread before all workers have completed. Used in main()
.
dap_events_worker_print_all
void dap_events_worker_print_all();
Prints to the log the number of e-sockets on each worker.
dap_events_worker_get_index_min
uint32_t dap_events_worker_get_index_min();
Specifies the index of the worker with the minimum number of e-sockets.
dap_events_worker_get_auto
dap_worker_t *dap_events_worker_get_auto();
Get a worker with a minimum number of e-sockets.
dap_events_worker_get
dap_worker_t * dap_events_worker_get(uint8_t a_index);
Returns a worker with the given index.
dap_events_worker_get_count
uint32_t dap_events_worker_get_count();
Returns the number of workers.
dap_get_cpu_count
uint32_t dap_get_cpu_count();
Returns the number of CPUs in the system.
dap_cpu_assign_thread_on
void dap_cpu_assign_thread_on(uint32_t a_cpu_id);
Binding the current thread to the CPU with index a_cpu_id
.
dap_events_socket.h dap_events_socket.c
Event sockets - work with them.
An event socket (esocket), dap_events_socket_t is a wrapper around an I/O object descriptor (handle) that unifies I/O processing for different objects (files, sockets, etc.). It contains callbacks, I/O buffers and a number of other data directly related to the event socket. In view of processing features, a pointer to dap_events_socket_t
should be treated as a handle outside its own thread context, and structure fields should be accessed only inside its own context, preferably through special functions with the _unsafe
postfix. It is worth noting separately that many functions are grouped in pairs: _unsafe
and _mt
- for thread-unsafe and thread-safe use. Always use _unsafe
inside your context, _mt
outside your context.
.worker
Pointer to the handler thread in whose context the event socket is processed. Can be NULL in case the event socket left the reactor contexts and, say, moved to the callback processor or somewhere else.
.server
If this event socket provides a connection to a remote client obtained using the dap_server_t
object, which is a wrapper around the listening socket, then this structure field will contain a pointer to this object. All others have it NULL.
.socket, .fd
A union of a socket handle and a POSIX file descriptor, a union can also be represented as native Windows handles, an mqueue handle, or other I/O handles.
.flags
Event socket flags. They may be as follows:
dap_events_socket_set_readable_unsafe
or dap_events_socket_set_readable_mt
function is called along with cocking/removing read event flags.dap_events_socket_set_writable_unsafe
or dap_events_socket_set_writable_mt
function is called along with cocking/removing the write event flags.queue_ptr_callback
that only passes a pointer to the data. The data itself is not transferred through such a queue, only a pointer is thrown there, which is convenient for transferring small message structures like dap_worker_msg_io_t
through which thread-safe I/O functions are implemented.._inheritor
Pointer to the child object (if any).
.type - esocket type.
dap_events_desc_type_t
The enumerated type of the event socket. Can be one of:
read()
/write()
send()
/recv()
are used and error codes for error_callback
' are obtained a little differently, otherwise everything the same. For beauty, the socket
and fd
fields are combined in union - however, you won’t have to work directly with them (and in the future this possibility will be removed altogether). The main thing to remember is that you can work directly with the dap_events_socket_t
fields only in the thread context of this object - in the context of a processing worker, or a callback processor thread, if the esocket and work with it are “thrown” there or somewhere else.pipe()
- its Linux version pipe2()
, POSIX queues mqueue
, or analogues. Everything is in blocking mode, so if the queue overflows, the send will hang. The difference from the pipe is that the transfer is in batches - 100 bytes were sent in one piece - 100 bytes also appeared on the output of the queue in one piece. The output of the queue is written to the fd
field, and the input is written to fd2
, which can be used later to send data to the queue. The queue is one-way, so the write/read flags have no meaning. The read flag is always set by default, and on the EPOLLIN event the data is read and passed to the queue_callback
.pipe()
in non-blocking threading mode.dap_events_socket_event_signal
function), since the file descriptor is lockable, and during processing the total result will be obtained in the second parameter in event_callback(dap_events_socekt_t *, uint64_r)
.epoll()
, for poll()
it will be POLLIN, for select it will be read_set
, and so on) read()
is called, and if the write flag is present the reaction to the EPOLLOUT event (for epoll()) is set and write_callback
is called, and then write()
on all data in the send buffer. action_callback
and all of its other union partners are not used..callbacks - esocket callbacks.
dap_events_socket_callbacks_t
A structure that collects event socket callbacks. All callbacks are executed in the context of the reactor handler thread (worker).
timer_callback // timer callback for listening socket
void (*) (dap_events_socket_t *)
.new_callback
void (*) (dap_events_socket_t * a_esocket,void * a_arg)
The callback initiated after creating an event socket and adding it to the reactor handler thread is executed in the context of the handler thread once, if a context change occurs later, the callback is not called. The a_esocket
argument passes a pointer to the event socket, a_arg
is always NULL and is not used (depricated).
.delete_callback
void (*) (dap_events_socket_t * a_esocket,void * a_arg)
This callback is called when the event socket is removed. After calling the callback, the memory allocated for the event socket itself is deleted, as well as the data of its successor, if they are in the ._inheritor
field. The a_esocket
argument passes a pointer to the event socket, a_arg
is always NULL and is not used (depricated).
.read_callback
void (*) (dap_events_socket_t * a_esocket,void * a_arg)
A callback that is executed after the read operation, it must process the incoming data. The a_esocket
argument passes a pointer to the event socket, a_arg
is always NULL and is not used (depricated).
.write_callback
void (*) (dap_events_socket_t * a_esocket,void * a_arg)
A callback that is executed before the write operation, it should prepare the data for sending. The a_esocket
argument passes a pointer to the event socket, a_arg
is always NULL and is not used (depricated).
.error_callback
void (*) (dap_events_socket_t * a_esocket, int a_errnum)
Error handler, a_esocket
argument passes a pointer to the event socket, a_errnum
passes the error code.
worker_assign_callback
void (*) (dap_events_socket_t *,dap_worker_t * )
It is called after successfully assigning an esocket to a worker.
.worker_unassign_callback
void (*) (dap_events_socket_t *,dap_worker_t * )
It is called after the esocket has been successfully disconnected from the worker.
union { // action callback depending on esocket type
.connected_callback // Connected callback for client socket
void (*) (dap_events_socket_t *)
Callback for processing a connection establishment by a client socket.
.accept_callback // Accept callback for listening socket
void (*) (dap_events_socket_t * a_esocket , int a_new_sock, struct sockaddr* a_new_sock_addr)
This callback is called after an incoming connection has been successfully received. a_esocket
is a pointer to the event socket listening for incoming connections, a_new_sock
is the socket of the new incoming connection, a_new_sock_addr
is a pointer to the structure with the remote address of the new incoming connection.
.event_callback // Event callback for listening socket
void (*) (dap_events_socket_t *, uint64_t)
.queue_callback // Queue callback for listening socket
void (*) (dap_events_socket_t *,const void * , size_t)
.queue_ptr_callback // queue_ptr callback for listening socket
void (*) (dap_events_socket_t *, void *)
} // union
NOTE: The ending of _mt in a function means its suitability for safe multithreaded use - thread-safety. The ending _unsafe - on the contrary, means that this function is unsafe in a multi-threaded environment and should only be called in the context of its thread. Functions with the ending _inter are a kind of _unsafe intended for I/O operations from their own context through a special inter-context queue.
dap_events_socket_create
dap_events_socket_t * dap_events_socket_create(dap_events_desc_type_t a_type, dap_events_socket_callbacks_t* a_callbacks);
Event socket (esocket) creation.
dap_events_socket_init() - esocket initialization
dap_events_socket_deinit() - esocket deinitialization
dap_events_socket_remove_from_worker_unsafe
void dap_events_socket_remove_from_worker_unsafe(dap_events_socket_t *a_es, dap_worker_t * a_worker);
Disconnecting an esocket from a worker.
dap_events_socket_delete_unsafe
void dap_events_socket_delete_unsafe(dap_events_socket_t * a_esocket , bool a_preserve_inheritor);
Deleting an esocket.
dap_events_socket_remove_and_delete_unsafe
void dap_events_socket_remove_and_delete_unsafe(dap_events_socket_t *a_es, bool preserve_inheritor);
Disconnecting from the worker and deleting the esocket.
dap_events_socket_remove_and_delete_unsafe_delayed
void dap_events_socket_remove_and_delete_unsafe_delayed(dap_events_socket_t *a_es, bool a_preserve_inheritor);
The same, with a delay.
dap_events_socket_remove_and_delete_mt
void dap_events_socket_remove_and_delete_mt( dap_worker_t * a_w, dap_events_socket_t* a_es);
Disconnecting from the worker and deleting the esocket thread-safe.
dap_events_socket_create_type_queue_ptr_unsafe
dap_events_socket_t * dap_events_socket_create_type_queue_ptr_unsafe(dap_worker_t * a_w, dap_events_socket_callback_queue_ptr_t a_callback);
Creates an event socket of type DESCRIPTOR_TYPE_QUEUE
(queue, flags=DAP_SOCK_QUEUE_PTR
) for thread-safe transfer of pointers through a kernel object of type "queue". It can have different implementations, in particular, on different platforms, and implemented both in the form of native pipe2
, mqueue
POSIX, pipe
or socketpair
, in the form of something Windows-specific, and, in the saddest cases, as a ring buffer with rwlock
.
Accepted parameters:
● a_w
is a pointer to dap_worker_t
on which the new object is created.
● a_callback
is a pointer to a function that handles incoming pointers from the queue, the function syntax is: void callback(dap_events_socket_t * a_esocket, void * a_ptr)
, where a_esocket
is a pointer to the event socket returned by the dap_events_socket_create_type_queue_ptr_unsafe
function, and a_ptr
is the pointer that comes from the queue. The callback will be executed in its own context dap_events_socket_t
in the a_w
worker specified for it and must use _unsafe
functions to work with its own data.
Return value:
Pointer to the event socket, in the context of which the callback will process the data.
Thread safety:
Insecure, use only in the worker's own context.
dap_events_socket_create_type_queue_ptr_mt
dap_events_socket_t * dap_events_socket_create_type_queue_ptr_mt(dap_worker_t * a_w, dap_events_socket_callback_queue_ptr_t a_callback);
Creating an esocket with the DESCRIPTOR_TYPE_QUEUE type (thread-safe implementation).
dap_events_socket_queue_proc_input_unsafe
int dap_events_socket_queue_proc_input_unsafe(dap_events_socket_t * a_esocket);
Reading from the queue and processing incoming data.
dap_events_socket_queue_ptr_create_input
dap_events_socket_t * dap_events_socket_queue_ptr_create_input(dap_events_socket_t* a_es);
Creating an inter-context (inter-thread) queue.
dap_events_socket_queue_ptr_send_to_input
int dap_events_socket_queue_ptr_send_to_input( dap_events_socket_t * a_es, void* a_arg);
Sending a pointer to the data into the inter-context (inter-thread) queue.
dap_events_socket_queue_ptr_send
int dap_events_socket_queue_ptr_send( dap_events_socket_t * a_es, void* a_arg);
Sends a pointer to some data to one of (depending on the platform/selected queue type) esocket queues.
dap_events_socket_create_type_event_unsafe
dap_events_socket_t * dap_events_socket_create_type_event_unsafe(dap_worker_t * a_w, dap_events_socket_callback_event_t a_callback);
Creating an esocket with type DESCRIPTOR_TYPE_EVENT (event).
dap_events_socket_create_type_event_mt
dap_events_socket_t * dap_events_socket_create_type_event_mt(dap_worker_t * a_w, dap_events_socket_callback_event_t a_callback);
Creating an esocket with type DESCRIPTOR_TYPE_EVENT (event) thread-safe.
dap_events_socket_event_proc_input_unsafe
void dap_events_socket_event_proc_input_unsafe(dap_events_socket_t *a_esocket);
Processing of events received by esocket.
dap_events_socket_event_signal
int dap_events_socket_event_signal(dap_events_socket_t * a_es, uint64_t a_value);
Sending an event message.
dap_events_socket_create_type_pipe_unsafe
dap_events_socket_t * dap_events_socket_create_type_pipe_unsafe(dap_worker_t * a_w, dap_events_socket_callback_t a_callback, uint32_t a_flags);
Creating an esocket with type DESCRIPTOR_TYPE_PIPE (pipe).
dap_events_socket_create_type_pipe_mt
dap_events_socket_t * dap_events_socket_create_type_pipe_mt(dap_worker_t * a_w, dap_events_socket_callback_t a_callback, uint32_t a_flags);
The same.
dap_events_socket_write_unsafe
size_t dap_events_socket_write_unsafe(dap_events_socket_t *sc, const void * data, size_t data_size);
Writing data to esocket output buffer (buf_out).
dap_events_socket_write_f_unsafe
size_t dap_events_socket_write_f_unsafe(dap_events_socket_t *sc, const char * format,...);
Write format string to esocket output buffer (buf_out).
dap_events_socket_write_mt
size_t dap_events_socket_write_mt(dap_worker_t * a_w, dap_events_socket_t *sc, const void * data, size_t data_size);
Packing data into a message and sending the message to the I/O queue (queue_es_io) of the worker.
dap_events_socket_write_f_mt
size_t dap_events_socket_write_f_mt(dap_worker_t * a_w, dap_events_socket_t *sc, const char * format,...);
The same, only as data - format string.
dap_events_socket_write_inter
size_t dap_events_socket_write_inter(dap_events_socket_t * a_es_input, dap_events_socket_uuid_t a_es_uuid, const void * a_data, size_t a_data_size);
Sending data to an inter-threaded queue.
dap_events_socket_write_f_inter
size_t dap_events_socket_write_f_inter(dap_events_socket_t * a_es_input, dap_events_socket_uuid_t a_es_uuid,const char * a_format,...);
The same, only as data - format string.
dap_events_socket_set_readable_mt
void dap_events_socket_set_readable_mt(dap_worker_t * a_w, dap_events_socket_t * a_es,bool a_is_ready);
Setting/clearing the esocket readiness flag for reading data.
dap_events_socket_set_writable_mt
void dap_events_socket_set_writable_mt(dap_worker_t * a_w, dap_events_socket_t * a_es,bool a_is_ready);
Setting/clearing the esocket ready to write data flag.
dap_events_socket_set_readable_unsafe
void dap_events_socket_set_readable_unsafe(dap_events_socket_t * sc,bool is_ready);
Setting/clearing the esocket readiness flag for reading data.
dap_events_socket_set_writable_unsafe
void dap_events_socket_set_writable_unsafe(dap_events_socket_t * sc,bool is_ready);
Setting/clearing the esocket ready to write data flag.
dap_events_socket_assign_on_worker_mt
void dap_events_socket_assign_on_worker_mt(dap_events_socket_t * a_es, struct dap_worker * a_worker);
Assigning an esocket to a worker (sending an esocket pointer to the worker's queue_es_new
queue).
dap_events_socket_assign_on_worker_inter
void dap_events_socket_assign_on_worker_inter(dap_events_socket_t * a_es_input, dap_events_socket_t * a_es);
Sending an esocket pointer to the interthreads pipe input.
dap_events_socket_reassign_between_workers_mt
void dap_events_socket_reassign_between_workers_mt(dap_worker_t * a_worker_old, dap_events_socket_t * a_es, dap_worker_t * a_worker_new);
A message with a pointer to the new worker is sent to the queue_es_reassign
queue of the worker from which the e-socket needs to be reassigned.
dap_events_socket_reassign_between_workers_unsafe
void dap_events_socket_reassign_between_workers_unsafe(dap_events_socket_t * a_es, dap_worker_t * a_worker_new);
The esocket is disconnected from the "old" worker, a pointer to it is passed to the buf_out
of queue_es_new_input
queue of the "new" worker (to the input of the inter-thread channel).
dap_events_socket_wrap_no_add
dap_events_socket_t *dap_events_socket_wrap_no_add(dap_events_t *a_events, int a_sock, dap_events_socket_callbacks_t *a_callbacks);
Creating an esocket as a wrapper around an existing socket.
dap_events_socket_wrap2
dap_events_socket_t * dap_events_socket_wrap2( dap_server_t *a_server, struct dap_events *a_events, int a_sock, dap_events_socket_callbacks_t *a_callbacks);
Creating an esocket as a wrapper around an existing socket.
dap_events_socket_pop_from_buf_in
size_t dap_events_socket_pop_from_buf_in(dap_events_socket_t *sc, void * data, size_t data_size);
Reading data from esocket buf_in
buffer.
dap_worker_esocket_find_uuid
dap_events_socket_t * dap_worker_esocket_find_uuid(dap_worker_t * a_worker, dap_events_socket_uuid_t a_es_uuid);
Search for an esocket at the worker by uuid identifier.
dap_events_socket_worker_poll_update_unsafe
void dap_events_socket_worker_poll_update_unsafe(dap_events_socket_t * a_esocket);
Poll status update.
dap_events_socket_descriptor_close
void dap_events_socket_descriptor_close(dap_events_socket_t *a_socket);
Close esocket descriptor.
dap_events_socket_shrink_buf_in
void dap_events_socket_shrink_buf_in(dap_events_socket_t * cl, size_t shrink_size);
Shift the contents of the buf_in
esocket buffer to the left by the given number of bytes.
dap_proc_queue.h dap_proc_queue.c
Thread's callback queue.
dap_proc_queue_t
The queue itself is a wrapper around dap_events_socket_t
with type DESCRIPTOR_TYPE_QUEUE
and the flag DAP_SOCK_QUEUE_PTR
.
dap_proc_queue_create
dap_proc_queue_t * dap_proc_queue_create(dap_proc_thread_t * a_thread);
Create a new thread callback queue a_thread
.
dap_proc_queue_delete
void dap_proc_queue_delete(dap_proc_queue_t * a_queue);
Delete the callback queue.
dap_proc_queue_add_callback
void dap_proc_queue_add_callback(dap_worker_t * a_worker, dap_proc_queue_callback_t a_callback, void * a_callback_arg);
Adding the a_callback
callback along with its a_callback_arg
argument to the callback queue of the a_worker
worker thread.
dap_proc_queue_add_callback_inter
void dap_proc_queue_add_callback_inter(dap_events_socket_t * a_es_input, dap_proc_queue_callback_t a_callback, void * a_callback_arg);
Adding the a_callback
callback along with its a_callback_arg
argument to the thread's callback queue of the a_worker
via its a_es_input
interthread queue.
dap_proc_thread.h dap_proc_thread.c
Callback processor threads.
dap_proc_thread_t
dap_proc_thread_init
int dap_proc_thread_init(uint32_t a_threads_count);
Initializing the callback processor, starting its threads.
dap_proc_thread_deinit
void dap_proc_thread_deinit();
Deinitialization of the callback processor, termination of all running threads.
dap_proc_thread_get
dap_proc_thread_t * dap_proc_thread_get(uint32_t a_cpu_id);
Get thread by index of the thread/cpu.
dap_proc_thread_get_auto
dap_proc_thread_t * dap_proc_thread_get_auto();
Get the least loaded thread (with minimum number of esockets).
dap_proc_thread_create_queue_ptr
dap_events_socket_t * dap_proc_thread_create_queue_ptr(dap_proc_thread_t * a_thread, dap_events_socket_callback_queue_ptr_t a_callback);
Creates an event socket of type DESCRIPTOR_TYPE_QUEUE
(queue, flags=DAP_SOCK_QUEUE_PTR
) by calling dap_events_socket_create_type_queue_ptr_unsafe
.
dap_proc_thread_assign_esocket_unsafe
int dap_proc_thread_assign_esocket_unsafe(dap_proc_thread_t * a_thread, dap_events_socket_t * a_esocket);
Assign an e-socket to the given (a_thread
) thread.
dap_proc_thread_assign_on_worker_inter
bool dap_proc_thread_assign_on_worker_inter(dap_proc_thread_t * a_thread, dap_worker_t * a_worker, dap_events_socket_t *a_esocket);
Assign an e-socket to a worker, via an inter-threaded queue.
dap_proc_thread_esocket_write_inter
int dap_proc_thread_esocket_write_inter(dap_proc_thread_t * a_thread, dap_worker_t * a_worker, dap_events_socket_uuid_t a_es_uuid, const void * a_data, size_t a_data_size);
Sending data to an inter-threaded queue queue_io_input
of a_thread
thread.
dap_proc_thread_esocket_write_f_inter
int dap_proc_thread_esocket_write_f_inter(dap_proc_thread_t * a_thread,dap_worker_t * a_worker, dap_events_socket_uuid_t a_es_uuid, const char * a_format,...);
The same, only as data - a format string.
dap_proc_thread_esocket_update_poll_flags
int dap_proc_thread_esocket_update_poll_flags(dap_proc_thread_t * a_thread, dap_events_socket_t * a_esocket);
Update system selector (poll
, epoll
, kqueue
,,,) flags.
dap_proc_thread_worker_exec_callback
void dap_proc_thread_worker_exec_callback(dap_proc_thread_t * a_thread, size_t a_worker_id, dap_proc_worker_callback_t a_callback, void * a_arg);
Send a callback to the worker for execution.
dap_server.h dap_server.c
Incoming connection processing module.
dap_server_t
A wrapper around a listening socket and an aggregator of event sockets associated with it - if the platform allows, they are created one for each reactor handler thread.
dap_events_socket_callbacks_t
structure.dap_server_type_t
dap_server_callback_t
dap_server_init
int dap_server_init();
Init server module.
Server module initialization.
dap_server_deinit
void dap_server_deinit( void );
Deinit server module.
Deinitialization of the server module.
dap_server_new
dap_server_t* dap_server_new(dap_events_t *a_events, const char * a_addr, uint16_t a_port, dap_server_type_t a_type);
Create a new server object dap_server_t
, start the server. The function takes arguments:
a_events
- pointer to dap_events_t
objecta_addr
- server IP addressa_port
- server porta_type
- server type, one of three: SERVER_TCP
, SERVER_UDP
or SERVER_LOCAL
dap_server_new_local
dap_server_t* dap_server_new_local(dap_events_t *a_events, const char * a_path, const char* a_mode, dap_events_socket_callbacks_t *a_callbacks);
Creation of a new local server, its launch.
dap_server_delete
void dap_server_delete(dap_server_t *a_server);
Removing the server object dap_server_t
.
dap_timerfd.h dap_timerfd.c
Working with timers.
dap_timerfd_t
A wrapper around a timer file descriptor.
dap_timerfd_init
int dap_timerfd_init();
Initialization of the timerfd module.
dap_timerfd_create
dap_timerfd_t* dap_timerfd_create(uint64_t a_timeout_ms, dap_timerfd_callback_t a_callback, void *a_callback_arg);
Create a dap_timerfd_t
object. Setting the timer to a_timeout_ms
.
dap_timerfd_start
dap_timerfd_t* dap_timerfd_start(uint64_t a_timeout_ms, dap_timerfd_callback_t a_callback, void *callback_arg);
Create a timer, cock it for a_timeout_ms
time, pass the timer's e-socket to the auto-selected worker (with the fewest e-sockets).
dap_timerfd_start_on_worker
dap_timerfd_t* dap_timerfd_start_on_worker(dap_worker_t * a_worker, uint64_t a_timeout_ms, dap_timerfd_callback_t a_callback, void *a_callback_arg);
Creating a timer, setting the a_timeout_ms
timeout, passing the e-socket of the timer to the a_worker
worker.
dap_timerfd_delete
void dap_timerfd_delete(dap_timerfd_t *l_timerfd);
Deleting a timer.
dap_worker.h dap_worker.c
Functions and data types for working with workers.
dap_worker_t
Structure of a worker with an I/O handler thread.
dap_events_worker_get_count
function.dap_proc_queue_t
queue through which new callbacks can be pushed to the callback processor.dap_worker_msg_io_t
dap_worker_msg_reassign_t
dap_worker_msg_callback_t
dap_worker_init
int dap_worker_init( size_t a_conn_timeout );
Workers module initialization.
dap_worker_deinit
void dap_worker_deinit();
Workers deinitialization.
dap_worker_thread
void *dap_worker_thread(void *arg);
Worker thread function.
dap_worker_add_events_socket_unsafe
int dap_worker_add_events_socket_unsafe( dap_events_socket_t * a_esocket, dap_worker_t * a_worker);
Adding an esocket to the worker (putting the socket descriptor in the event polling list).
dap_worker_add_events_socket
void dap_worker_add_events_socket(dap_events_socket_t * a_events_socket, dap_worker_t * a_worker);
Thread-safe adding an esocket to a worker (sending an esocket pointer to the worker's queue_es_new
queue).
dap_worker_add_events_socket_inter
void dap_worker_add_events_socket_inter(dap_events_socket_t * a_es_input, dap_events_socket_t * a_events_socket);
Adding an esocket via an inter-thread queue.
dap_worker_add_events_socket_auto
dap_worker_t *dap_worker_add_events_socket_auto( dap_events_socket_t * a_events_socket );
Thread-safe addition of an esocket to an auto-selected worker (one with fewer esockets than others).
dap_worker_exec_callback_on
void dap_worker_exec_callback_on(dap_worker_t * a_worker, dap_worker_callback_t a_callback, void * a_arg);
Sending a callback to the worker's callback queue.