Earlier quoted context omitted.
That's the reason for the thread pool, and the resulting thread affinity issue.
This seems to assume that the same green thread will always run on the same native thread, which I don’t think is universally the case.
Zig's New Async I/O
291–293 of 293 posts
Re: Zig's New Async I/O
#292Earlier quoted context omitted.
> Afaik it's the only way to early-abort an operation since Goroutines operate in a cooperative, not preemptive, paradigm. I'm not sure what you mean here. Preemptive/coorporative terminology refers to interrupting (not aborting) a CPU-bound task, in which case goroutines are fully preemptive on most platforms since Go 1.14, check the release notes for more info. However, this has nothing to do with context. If you'r…
Goroutines are preemptive only to the runtime scheduler. You, the application developer merely using the language, cannot directly preempt a goroutine. This makes goroutines effectively cooperative still from the perspective of the developer. The preemptive runtime "just" prevents things like user code starving out the garbage collector. To interrupt a goroutine, your options are generally limited to context cancelat…
Re: Zig's New Async I/O
#293I wrote a simple ssh server in zig to learn the language in my spare time. The new design makes the event loop / io much easier to reason about. Thanks Andy
Is there any chance you've published your project? It would be fun to read the code.