   It preserves the local state of execution and allows re-entering subroutines
      more than once (useful if state must be kept across function calls).
    </p>
<p>
      Coroutines can be viewed as a language-level construct providing a special
      kind of control flow.
    </p>
<p>
      In contrast to threads, which are pre-emptive, <span class="emphasis"><em>coroutine</em></span>
      switches are cooperative (programmer controls when a switch will happen). The
      kernel is not involved in the 