Skip to content

v0.5.0 — Features: subscriber count, UMONITOR/UMWAIT, PodBus

Choose a tag to compare

@userFRM userFRM released this 20 Mar 21:53
· 31 commits to main since this release

Closes #18, #4, #3, #2.

New features

Subscriber count per topic (#18)

Query how many subscribers are reading a topic — enables lifecycle management for processors.

let count = pub_.subscriber_count(&topic)?;
if count == 0 { /* skip publishing, tear down processor */ }

FFI: crossbar_topic_subscriber_count(pub_, topic)

UMONITOR/UMWAIT for Intel Alder Lake+ (#3)

New WaitStrategy::MonitorWait variant that uses Intel WAITPKG instructions for cache-line-aware low-power waiting (~30ns wakeup vs ~1ms sleep).

let guard = stream.recv_with(WaitStrategy::MonitorWait)?;

Falls back to PAUSE on unsupported CPUs. CPUID detection cached.

PodBus<T: Pod> SPMC broadcast ring (#2)

Single-producer, multi-consumer broadcast ring where publish cost is O(1) regardless of subscriber count.

let bus = PodBus::<u64>::new(256);
let mut sub = bus.subscriber();
bus.publish(42);
assert_eq!(sub.try_recv(&bus), Some(42));

Prefetch next ring slot on publish (#4)

Hides RFO stall in multi-core scenarios by prefetching the next slot's cache line before the current write.

Stats

  • 46 tests + 5 doc-tests, all passing
  • +849 lines across 16 files

Full changelog: https://github.com/userFRM/crossbar/blob/main/CHANGELOG.md