r/cpp • u/germandiago • Jun 30 '26
Stackful fibers with 3.6ns context switch. Silk fibers.
https://clickhouse.com/blog/silkI just read an article about Silk, the new stackful fibers engine from Clickhouse. It can switch stackful fibers at an amazing 3.6ns and does not allocate on steady state.
Maybe asio could reuse some of the knowledge for the linux/io_uring backend (not sure it applies to the specific case since Boost.asio focuses nowadays on stackless, though it has a fibers and a stackful coros backend also).
51
Upvotes
View all comments
Show parent comment
3
u/germandiago Jun 30 '26
Maybe I swallowed the sales pitch? I thought it was an achievement.
But it looks like it goes through specialization. However, not using slab allocation seems to be an improvement (even if not a revolution).
Regarding context switch, I think it is more nuanced: since no allocation happens in steady state, this is guaranteed. Stackless breaks HALO easily. However, I guess operator new can be overloaded for such cases as well.