Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Today I was reading several articles on the Internet about fibers, coroutines and green threads, and it seems like these concepts have very much in common, but there are slight differences, especially when we talk about fibers and coroutines.

Is there a concise, correct summary of what makes them different from each other?

share|improve this question
Did you even try googling? Searching for any two of those terms turns up two Stack Overflow questions (links here and here). – Doval Aug 22 '14 at 15:05
I saw that thread, but it is not concise. If you take a closer look, the accepted answer says that fibers are the same as coroutines, while the second answer, which I believe is better, says that they are different things. The second link is about thread vs fiber - my question is not about threads. – DejanLekic Aug 22 '14 at 15:12
@gnat: See below (answered in less than 150 words). – Robert Harvey Aug 22 '14 at 15:15
@RobertHarvey see above – gnat Aug 22 '14 at 15:20
@gnat I don't even understand your last comment. Are you saying that because there are two related (but not identical) SO questions already, the new one isn't "reasonably scoped"? – Kyle Strand Aug 22 '14 at 20:21
up vote 64 down vote accepted

A Fiber is a lightweight thread that uses cooperative multitasking instead of preemptive multitasking. A running fiber must explicitly "yield" to allow another fiber to run, which makes their implementation much easier than kernel or user threads.

A Coroutine is a component that generalizes a subroutine to allow multiple entry points for suspending and resuming execution at certain locations. Unlike subroutines, coroutines can exit by calling other coroutines, which may later return to the point where they were invoked in the original coroutine.

A Green Thread is a thread that is scheduled by a virtual machine (VM) instead of natively by the underlying operating system. Green threads emulate multithreaded environments without relying on any native OS capabilities, and they are managed in user space instead of kernel space, enabling them to work in environments that do not have native thread support.

share|improve this answer
I can only say for myself - this answer is very valuable to me. I share opinion with Robert on this. – DejanLekic Aug 22 '14 at 15:16
+1 I hadn't even heard about Green Threads. – Felix Dombek Aug 22 '14 at 15:17
"Summaries of broad topics are specialty of Wikipedia, which is focused and optimized on providing this content and fostering a culture oriented on it. People willing, best capable of and experienced in providing such summaries go to Wikipedia, not to Stack Exchange.... People looking for this in search engine would be typically presented two directly competing content examples, one at SE network, another at Wikipedia... Due to reasons mentioned above, it is most likely that SE content would look inferior in comparison..." – gnat Aug 22 '14 at 15:39
@gnat Compare/contrast topics are not "broad." They are specifically focused in such a way that Wiki articles are rarely suited for. Yes, the three Wiki articles linked in the answer are helpful for someone trying to understand these three topics, but a concise summary of the topics themselves, juxtaposed so as to quickly show their similarities and differences (which admittedly this answer could do more explicitly), is not something likely to be best done as a Wiki article. – Kyle Strand Aug 22 '14 at 20:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.