Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

concurrency
coroutine
coroutines

What is a Coroutine?

Educative Answers Team

The word “coroutine” is composed of two words: “co” (cooperative) and “routines” (functions).

Coroutines are functions that are cooperative.

How are functions non-cooperative?

Usually, when a function calls a second function, the first cannot continue until the second function finishes and returns to where it was called.

The control remains with the second function until it executes completely and only then can the control return to the first one.

svg viewer