|
Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
|
This guide helps developers transition from traditional C++ concurrency patterns (std::function, thread pools with mutexes, boost::asio, boost::sml) to Corium's zero-heap C++20 MPSC architecture.
boost::asio | corium::async | Advantage in Corium |
|---|---|---|
asio::awaitable<T> | corium::async::Task<T> | 0 heap allocation on resumption |
asio::steady_timer::async_wait | corium::async::delay(ms) | Zero dynamic handler allocation |
asio::experimental::make_parallel_group | corium::async::whenAll() / whenAny() | Type-safe compile-time tuple unpack |
| Cancellation slots | corium::async::CancellationToken | Lock-free atomic cancellation awaiter |
| Feature | Traditional Pattern | Corium Equivalent |
|---|---|---|
| Event Dispatch | std::function<void(E)> | corium::Application<Derived>::onEvent(E) |
| Event Posting | std::queue<E> + std::mutex | corium::EventSinkT<EventVariant>::post(e) |
| High-Priority Alert | Queue sorting / separate mutex | sink.post(e, corium::EventPriority::High) |
| Delayed Event | std::thread + sleep | runtime.postDelayed<E>(delay, event) |
| Hardware ISR Push | Disable IRQ + raw circular queue | corium::embedded::IsrEventSink::postFromIsr() |
| Log Formatting | spdlog / printf | corium::logging::LoggerT + JsonLogSink |
| Inter-Process IPC | Socket + Protobuf | corium::ipc::IpcChannel / PlatformChannel |