crossbeam-channel 使用纯用户空间的自旋锁,在某些情况下性能非常差
作者: bsilver8192创建于 2022年5月4日更新于 2026年7月12日
标签crossbeam-channel
crossbeam-channel seems to use pure spinlocks (which never block in the kernel), from userspace, which is a bad idea. Looking at the behavior with `strace`, it appears to be `sched_yield`ing in a loop. On my Linux system (Debian 5.15 kernel, standard configuration) with a simple little benchmark I wrote, I see this:
内容来源: crossbeam-rs/crossbeam