9 Fibers
A FIBER is a lot like a thread in that it represents some in-progress work inside a process. The difference is that a fiber enjoys lightweight, cooperative scheduling and builds directly on top of the existing Windows support for preemptive scheduling. Due to their lightweight nature, careful use of fibers can sometimes yield more efficient scheduling, particularly for large amounts of work that frequently blocks. And because fibers are scheduled cooperatively, user-mode code is given more control over scheduling decisions.
Fibers are particularly interesting for the future because they are the only mechanism on Windows to allow cooperative scheduling of large amounts of work. The thread pools come close, but still rely heavily on ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access