Skip to content
0:00 / 0:00

#fibers#cats-effect#concurrency

Fabio Labella—How do Fibers Work? A Peek Under the Hood

Scala World

5.9K subscribers • 13 videos on Hallway

YouTube
  • Recommended by 2 people: 1 on Lobsters and 1 in engineering communities.
  • A classic. People kept recommending it from 2020 to 2024.
  • Presented by Fabio Labella

Advanced. Deep dive for people who know the field.

17K views7 years ago2 recommendations

Systems programmingProgramming languagesConcurrency and parallelismScalaPerformance and optimization

Fabio Labella explains the inner workings, scheduling, and execution of fibers in functional concurrency libraries.

The uploader added no description.

Why it's here

2 people recommend this

What people say. Recommended as an insightful talk explaining key fundamental ideas of concurrency and fibers.

u/Laseringin r/scala • Recommends

Looking for keynotes with very good insights and/or explaining some key fundamental ideas Like the title says. Let me give you some examples: - Constraints Liberate, Liberties Constrain - Runar Bjarnason - Simple Made Easy - Rich Hickey - How do Fibers Work? A Peek Under the Hood - Fabio Labella - Introduction to ScalaCheck - Noel Markham - High Wizardry in the Land of Scala - Daniel Spiewak - Roll Your Own Shapeless - Daniel Spiewak - Type Members vs Type Parameters - Jon Pretty - Doing Batshit Crazy Algebra with Scala Types! - Jon Pretty

agent281on Lobsters • Recommends

How do Fibers Work? A Peek Under the Hood (2019)

u/BarneyStinsonin r/scala • Mentions

On “Cats Effect - How it works technically?”

How do fibers work

u/justinhjin r/scala • Mentions

On “How do effect systems work?”

…a for a nice introduction to this. Monix, Zio and Cats Effect have all contributed a huge amount of sophistication on top of this basic effect from stack safety and principled error handling, to advanced run-times with green threads and interruption semantics. Fabio Labella has made a wonderful talk about what these additional layers look like: [video This starts with the basics but goes a really long way in an hour and I think it will answer your question about how different async requests are handled. I think this is a different thing to "effect tracking". That refers to using the IO monad to track effects in the sense that you can isolate effects from the rest of your program, which…

u/Avasil2Monix.ioin r/scala • Mentions

On “Questions about ZIO fiber vs Project Loom fiber”

Recently there was a presentation about how it works under the hood by Fabio Labella that should clear a lot of things, I highly recommend it: link to this video Fibers that we talk about in Scala are just a layer of abstraction on top of threads. There's not that much to it. Many functional effect libraries (e.g. Cats-Effect, Monix, scalaz.Task) have been using these ideas for years but they barely mention Fiber keyword. ZIO is a bit different here because it embraces it more and adds extra features like a supervision but the core idea is the same. I don't know enough about Project Loom fibers to make a comparison.

u/justinhjin r/scala • Mentions

On “Best Scala/FP talks”

What topics are you interested in specifically? Some I've been rewatching recently... John de Goes: One Monad to Rule Them All [video Fabio Labella—How do Fibers Work? A Peek Under the Hood [video And a couple of other classics... Luka Jacobowitz—Monoids, Monoids, Monoids [video Functional Programming with Effects by Rob Norris [video

u/Laseringin r/scala • Mentions

On “Why do you prefer IO over Future?”

Futures use a system thread which is a very expensive resource, especially for context switches. IO uses fibers, which are like user-land threads. These are way cheaper. I'm of course simplifying especially if you use the latest versions of the JVM which have fibers built-in. I recommend this awesome video to understand this more: link to this video

u/skrbic_ain r/scala • Mentions

On “What is the fastest way to get good at Cats Effect (and all the theory behind it)?”

Rock the JVM courses and books by Gabriel Volpe Also there is a lot of good conference talks, just try to watch as many as possible, even if they are 5+ years old, it's worth it. Just couple of talks that were super useful to me long time ago: \* [video \* [video \* [video

u/Koisellin r/scala • Mentions

On “Why does instantiating a Future not require an ExecutionContext but mapping / recovering from one does?”

You probably have a Cats Effect ContextShift in the scope which kinda like Scala ExecutionContext which is kinda like the Java one. I'm not expert on the cats's internals but I recommend you this video link to this video

u/BalmungSanin r/scala • Mentions

On “Fibers in Cats Effect - an explanation of the behavior”

For the blocking part yeah they are different, but the underlying solution is very similar: not blocking a compute thread. This is a great read about how to manage your threads. About preemption I guess that mostly depends on the runtime system, but I may be wrong _(I still confuse many of these details)_, I would recommend you this talk by Fabio which explains how fibers work, maybe you will find your answer there :) Yeah in that example the fiber which is waiting for the `join` of the other fiber won't be blocking a thread. But again, this is just because the runtime system allows it and the `join` operation is aware that it is blocking so it notifies the runtime system. But current I…

u/Avasil2Monix.ioin r/scala • Mentions

On “ZIO + Spark = Zparkio”

…hread which is the same thing Future is doing. So if the thread is blocked due to the usage of blocking IO then it will waste entire thread regardless if you use ZIO, Future or other effect. I think your assumption might be based on "real" fibers and we don't have them yet. If you're interested in this topic then I can recommend this presentation: link to this video IO monads might perform better than Future for any operations where there is a lot of flatMapping because it's not as optimized for Future and can introduce a lot of redundant async boundaries (pre 2.13)…

u/paul_f_snivelyin r/scala • Mentions

On “Book / Source Recommendation concurrency and parallelism”

Easily 80% of what anyone needs to know about concurrency and parallelism is right here. _Some_ developers will need to pay particular attention to the “choosing a thread pool” section. Extreme special cases will benefit from Fabio Labella’s fibers presentation. It’s perfectly fine, though, to use `IO` or fs2’s `Stream` and their various concurrent and parallel combinators, especially in an `IOApp`, without worrying about how it works under the hood beyond “unbounded queue is another name for ‘memory leak.’”

u/Hyperspace-Bureauin r/scala • Mentions

On “This week in #Scala (Sep 9, 2024)”

Wonderful talk by Fabio Labella: link to this video …but why did this appear in “This week in #Scala” @petrzapletal