According to Eric eilebrecht's blog, the fiber does not reduce the memory overhead or have better performance. When we need to use a large number of threads (such as more than 100), the total overhead of stack space of each thread increases linearly, and the overhead of thread switching takes too much time, it may even exceed the overhead of program execution. At this time, we need to design a management mechanism similar to the thread pool, and use a small number of threads to allocate and execute many tasks. Fiber is the implementation of a set of such mechanisms provided by the system, saving us the trouble of designing and making ourselves.
Therefore, each fiber still has its own stack and does not reduce memory overhead. However, multiple fiber threads may be executed on the same thread, that is, the fiber does not have its own Thread Local Storage and static variables, any code dependent on them cannot be executed normally in the fiber path.
Therefore, fiber is only useful in some extreme situations, such as SQL Server, and the cost for general situations is generally far greater than the benefits.