The name coroutine suggests that in some sense they should be dual to (sub)routines. Is there a real mathematical duality? I'm hoping for something like "in category theory subroutines are X and coroutines are Y, where X is dual to Y".
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
I think this a misanalysis of the "co" prefix in this case.
"Coroutine" is "co" in the sense of "co-worker"; something that works together with another.
The term precedes by a long way the gross overuse for programming concepts of the prefix "co" in the Category Theoretic sense of a dual of another concept.
(Yes, there is editorial content there. ;-) )