Coroutine

Part of speech: noun

Definitions

  1. A subroutine that can pause execution to allow other subroutines to run and then resume where it left off; a programming structure enabling cooperative multitasking by yielding control explicitly; a function or routine designed to be suspended and resumed for concurrent operations
  2. A routine designed to yield control to other routines during execution and return later upon resumption; a programming construct supporting asynchronous processes by pausing and restarting; a block of code that cooperatively multitasks by voluntarily suspending execution
  3. A programming function capable of suspending its processing to give time to others and continuing later; a code segment intended for asynchronous execution through explicit pausing and resuming; a cooperative multitasking routine that allows interleaved operation with other coroutines through suspension and continuation

Etymology: Melvin Conway, an American computer scientist, coined "coroutine" in 1958 when he needed a name for programs that could pause and later resume where they left off, rather than running straight through to an end. The word is a deliberate construction: the prefix "co-", meaning "together" or "with each other," joined to "routine," so the sense is routines working in partnership, each handing control to the other. "Routine" has a longer and more surprising past. It descends from Latin "rumpere," "to break," through its past participle "ruptus," and passed into Old French as "route," meaning a broken or beaten path, the track a group of people or animals had made by repeatedly traveling it. From that sense of a worn way came the idea of a habitual course of action, and in English "routine" took on the meaning of a fixed, repeated sequence. Conway's word thus joins a term for a path worn by repetition with the idea of cooperation.

Synonyms: task, thread, process, fiber, generator