C · Threads and Polling

Threads and Polling

#include <ucall/types.h> 1.0.0-rc.1 · 60202332

UCall creates no threads. Each loop has one application polling owner, and endpoint callbacks execute synchronously on that caller. Each batch endpoint has one polling owner, and its callbacks execute on the thread calling ucall_server_take_batch() or ucall_server_take_batches() with the handle its registration returned. A deadline cannot preempt a callback. One owner at a time may submit, poll, or free a client, on any thread. CPU classes select compiled string, cryptographic, and atomic kernels once, at initialization, under the requested class or the initialization thread’s capabilities. The application keeps those threads on CPUs supporting the selected class; serial is the conservative choice for differing capabilities. Server shutdown uses baseline atomics and native wakeups, so another thread can stop it without entering CPU-specific code.

API

Types

ucall_cpu_class_tA CPU kernel bundle, named with the same native classes as the sibling libraries.
types.h:81 ↗
enum ucall_cpu_class_t

Values

ucall_cpu_class_unknown_k0No class requested: initialization picks the best class this machine runs.
ucall_cpu_class_serial_kPortable kernels with no SIMD, which every machine runs.
ucall_cpu_class_intel_haswell_kAVX2 kernels, as on Intel Haswell.
ucall_cpu_class_intel_skylake_kAdds AVX-512 kernels, as on Intel Skylake-X.
ucall_cpu_class_intel_icelake_kAdds Ice Lake's AVX-512 extensions and SHA, as on Intel Ice Lake.
ucall_cpu_class_intel_alder_kAVX2 kernels with SHA and no AVX-512, as on Intel Alder Lake.
ucall_cpu_class_aws_g2_kNEON kernels with the AES and SHA extensions, as on AWS Graviton2.
ucall_cpu_class_aws_g5_kAs on AWS Graviton5, running the kernels of ucall_cpu_class_aws_g2_k.
ucall_cpu_class_monoversioned_kThe one class a monoversioned build compiles, over every capability it targets.

Spellings

char const * ucall_cpu_class_name(ucall_cpu_class_t cpu_class);
ucall_cpu_class_t ucall_cpu_class_from_name(ucall_bytes_view_t name);