Silk: Open-source cooperative fiber scheduler

github.com

91 points by animetyan 4 days ago


cyphar - an hour ago

It's interesting how some ideas very quickly start popping up everywhere at once. One of my colleagues was working on adding support for fibers to systemd for some time (and the PR was merged a few days ago[1]!). From my understanding, this model is really quite useful for programs like pid1 that cannot use threads.

[1]: https://github.com/systemd/systemd/pull/39771

audidude - 3 hours ago

I've been doing this with something very similar in GNOME for years now. It also does io_uring, threadpool schedulers, workstealing, "pollable semaphores" (like IRIX), profiler integration, and makes fibers implemented as futures themselves.

https://github.com/GNOME/libdex/

nasretdinov - 9 hours ago

Looks really interesting. I assume this suggests that ClickHouse is going to gradually switch to using this library for network and I/O, thus addressing the main weakness (in my mind) of C++ thread-per-connection servers, which is, they (surprisingly!) create too many threads and can't really handle more than, say, a thousand active connections at the same time. It mostly matters for async INSERTs in this case of course, not for SELECTs, although generally it applies to both.

jeffreygoesto - 8 hours ago

Is this comparable to Sea star [0]?

[0] https://github.com/scylladb/seastar

enduku - 7 hours ago

The `Cilk` angle is interesting. There’s still room for small runtimes focused just on fork/join recursion.

I’ve been working on one for C: https://github.com/xtellect/cactus

It’s narrower than Silk/SeaStar: continuation stealing for CPU-bound recursive code, not a general async I/O fiber runtime.

bbkane - 5 hours ago

Looks like its using MinIO for the S3 benchmark, which is now archived. I wonder what they'll switch to (if anything)

feverzsj - 8 hours ago

Seems not exception safe when task switching during unwind.

yvdriess - 8 hours ago

Play on Cilk?

idlepig - 8 hours ago

[flagged]

embirdating - 8 hours ago

[dead]

stefantalpalaru - 42 minutes ago

[dead]

fleahunter - 5 hours ago

[flagged]

SeattleAntifa - 5 hours ago

[dead]

znnajdla - 4 hours ago

those who don't learn Erlang/Elixir are bound to reinvent the Erlang VM and OTP model.