std::string_view cpu_class_name(ucall_cpu_class_t cpu_class) noexcept; The interface starts no threads and needs no runtime: every callback runs on a thread the application gave to a polling call.
- A route handler runs on the thread inside
take_callortake_callsfor the event loop that received the request. - A
pooled_batchhandler runs on the thread insidetake_batchortake_batchesfor its endpoint, never on an event loop, while alocal_batchhandler runs insidetake_callortake_callsfor the loop whose requests it holds. - A server’s peer authorizer runs on the polling thread completing the handshake, and a client’s on the client’s own thread inside
take_completedor a blocking call. - A deferred reply or pull finishes as its event loop polls, so its awaiter re-polls through the caller’s scheduler on that same thread.
Each event loop and each batch endpoint has one polling owner at a time. take_calls and take_batches run until server_t::stop, while take_call and take_batch return after one round, waiting up to their timeout, so a loop of them interleaves polling with other work, such as a scheduler’s posted polls. server_t::stop works from any thread, handlers included, and wakes every polling thread.
The first stop drains, answering every request already held before its connection closes, and a second one cuts the replies still in flight.
A client bound to a server through client_options_t::server advances only as that loop polls, so it is used on that loop’s thread, and its blocking calls would wait forever there.
Every thread that polls, replies or reads must run on a CPU supporting the CPU class the server or client resolved at start, so ucall_cpu_class_serial_k is the safe choice on machines mixing CPU generations.
API
Functions
cpu_class_nameThe stable name of a CPU kernel class, such as "intel-icelake".
cpu_class_from_nameReads a CPU kernel class back from its stable name, "unknown" included.
expected<ucall_cpu_class_t> cpu_class_from_name(
std::string_view name) noexcept;