Live data from Hacker News

Fibers, Oh My (2020)

graphitemaster.github.io

1–10 of 15 posts

Re: Fibers, Oh My (2020)

#2
> What if our fibers invoke operating system primitives that block, or interfaces which indirectly do?

The best fiber interfaces, like virtual threads in Java, intercept these blocking primitives and perform the yield there implicitly. This means that user code just doesn't need to worry about this at all and can block as they normally would.

Re: Fibers, Oh My (2020)

#4

> What if our fibers invoke operating system primitives that block, or interfaces which indirectly do? The best fiber interfaces, like virtual threads in Java, intercept these blocking primitives and perform the yield there implicitly. This means that user code just doesn't need to worry about this at all and can block as they normally would.

Same with go.

Re: Fibers, Oh My (2020)

#5
Meh, their engine scalability was/is a disaster on PC. Especially as far as CPUs are concerned. IdTech 7 is where it's at. 500fps+ of goodness... give it what you have, it will take all of your cores, every single one, and run even faster.

Re: Fibers, Oh My (2020)

#6
post #4

> What if our fibers invoke operating system primitives that block, or interfaces which indirectly do? The best fiber interfaces, like virtual threads in Java, intercept these blocking primitives and perform the yield there implicitly. This means that user code just doesn't need to worry about this at all and can block as they normally would.

Same with go.

[deleted]

Re: Fibers, Oh My (2020)

#7

> What if our fibers invoke operating system primitives that block, or interfaces which indirectly do? The best fiber interfaces, like virtual threads in Java, intercept these blocking primitives and perform the yield there implicitly. This means that user code just doesn't need to worry about this at all and can block as they normally would.

And Node.js

Re: Fibers, Oh My (2020)

#8
Parts of this, especially the first few chapters, sound very similar to what I wrote earlier that year (and have then kept updating for another year):

https://github.com/slouc/concurrency-in-scala-with-ce

I also later distilled it into this one:

https://slouc.com/Fibers/

Would be fun to believe that something I wrote inspired parts of this one, but in reality it's probably just a case of great minds thinking (and sounding) alike :)

Anyway, I'm glad to have found this great text. I agree with the author's statement that "there’s a distinctive lack of good information online", because I felt the same way writing mine. Thanks hn and whoever (re)posted this.

Re: Fibers, Oh My (2020)

#10

I worked on a fiber-based backend once. had fun also with mmaps and signals. lots of low-level Linux optimizations and edge case 9's pursuit.

Ditto (we had hand-rolled a coroutine system implemented in the most pedestrian manner you could imagine). Compared to the usual sea-of-threads and all the synchronization hell that falls out of that, a coroutine-based system was absolutely magical. Vastly fewer threading bugs.

Being able to meaningfully support 500K users on a single mid-grade server was also great for the pocketbook. (When I saw the sheer scale of the Twitter servers a while back, I was gasping for air).

Post reply on HN