Re:Resource efficient Thread Pools with Zig
by skohan on Monday September 13, 2021 @11:40AM
(#28512869)
Honestly tokio is so complex, and it serves so many use-cases it's hard for me to believe it could ever be truly optimal for any one use-case.
[ Parent
| on HN ]
Re:Resource efficient Thread Pools with Zig
by kristoff_it on Monday September 13, 2021 @11:52AM
(#28513043)
Isn't Go's scheduler just as versatile?
Re:Resource efficient Thread Pools with Zig
by skohan on Monday September 13, 2021 @12:19PM
(#28513342)
I'm not an expert on the go scheduler, but my perception is that it is more of a focused single-purpose component whereas tokio seems like a sprawling swiss-army-knife of a library if you browse the source
Re:Resource efficient Thread Pools with Zig
by bbatha on Monday September 13, 2021 @05:27PM
(#28517103)
The tokio scheduler and the go scheduler are roughly equivalent. Much of tokios bulk is reimplementing much of the std lib in an async compatible way (io, os, blocking).
Re:Resource efficient Thread Pools with Zig
by kprotty on Tuesday September 14, 2021 @08:45AM
(#28523889)
If you browse the source, the go scheduler has complexities to deal with that tokio doesn't as well. The thread pool is unified between worker threads & blocking threads. Go also does goroutine preemption via signaling/SuspendThread + a background monitor thread called sysmon. Go does garbage collection and the tracing/race-detection/semantics are tightly coupled to both its allocator and it's scheduler. Go also exposes and maintains its entire standard library which includes an http client/server (tokio the org maintains their own as hyper but its separated from tokio the runtime). It can be fair to argue that Go is just as "swiss-army-knife" of a system as tokio.
Re:Resource efficient Thread Pools with Zig
by tick_tock_tick on Monday September 13, 2021 @03:13PM
(#28515496)
It's much more versatile but also has many more years of optimization.