coroutine
Sign in to saveAlso known as Coroutines
Coroutines are computer program components that allow execution to be suspended and resumed, generalizing subroutines for cooperative multitasking. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.
~25 min read
Encyclopedic overview
37 sectionsContents
- Definition and types
- Comparisons
- Subroutines
- Threads
- Generators
- Mutual recursion
- Common uses
- Native support
- Implementations
- C
- C++
- C#
- Clojure
- D
- Go
- Java
- JavaScript
- Kotlin
- Lua
- Modula-2
- Mono
- .NET Framework
- OCaml
- Perl
- PHP
- Python
- Racket
- Ruby
- Scheme
- Smalltalk
- Tcl
- Vala
- Assembly languages
- See also
- References
- Further reading
- External links
Coroutines are computer program components that allow execution to be suspended and resumed, generalizing subroutines for cooperative multitasking. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.
They have been described as "functions whose execution you can pause".
Excerpted from Wikipedia’s “coroutine” article, available under the CC BY-SA 4.0 licence.