I am reading a lot about Fibers, or green threads, or whatever other name we can give to userland threads. I started reading documentations and tutorials (these are C++ links, but I don't need a specific language):
- Distinguishing coroutines and fibers
- Producer/Consumer using Boost.Fibers
- Boost.Fiber documentation
- Many, many others
However, it seems I cannot grasp the essentials about fibers. I know that fibers are a way to cooperatively multitask, but documentation about interplay between threads and fibers in actual cases are, as far as I found, scarce.
What are some practical use cases of fibers?
For instance, every doc actually uses async I/O as an example, but what if I don't have I/O-bound problems? For instance, what if my problem is counting words in a huge file? Here I would just split the file among threads, can fibers help somehow? I suppose that CPU-bound computations such as numerical problems (e.g., matrix/vector operations) are not suitable for fibers, but again, I might be completely wrong.