Fibers, Oh My (2020)
graphitemaster.github.io
Fibers, Oh My (2020)
1–10 of 15 posts
Re: Fibers, Oh My (2020)
#2The 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)
#3Fibers, Oh My - https://news.ycombinator.com/item?id=24679740 - Oct 2020 (69 comments)
(Reposts are fine after a year or so; links to past threads are just to satisfy extra-curious readers)
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.
Re: Fibers, Oh My (2020)
#5Re: Fibers, Oh My (2020)
#6> 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)
#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.
Re: Fibers, Oh My (2020)
#8https://github.com/slouc/concurrency-in-scala-with-ce
I also later distilled it into this one:
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)
#9Re: Fibers, Oh My (2020)
#10I 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.
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).