In computer science, a fiber is a particularly lightweight thread of execution.
Like threads, fibers share address space. However, fibers use co-operative multitasking while threads use pre-emptive multitasking. Threads often depend on the kernel's thread scheduler to preempt a busy thread and resume another thread; fibers yield themselves to run another fiber while executing. The article on threads contains more on the distinction between threads and fibers.
== Fibers and coroutines ==
Fibers describe essentially the same concept as coroutines. The distinction, if there is any, is that coroutines...