Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Coroutine
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Computer software component}} {{external links|date=April 2024}} '''Coroutines''' are [[computer program]] components that allow execution to be suspended and resumed, generalizing [[subroutine]]s for [[non-preemptive multitasking|cooperative multitasking]]. Coroutines are well-suited for implementing familiar program components such as [[cooperative multitasking|cooperative task]]s, [[exception handling|exception]]s, [[event loop]]s, [[iterator]]s, [[lazy evaluation|infinite list]]s and [[pipeline (software)|pipe]]s. They have been described as "functions whose execution you can pause".<ref>{{Cite web |date=2016-02-11 |title=How the heck does async/await work in Python 3.5? |url=https://snarky.ca/how-the-heck-does-async-await-work-in-python-3-5/ |access-date=2023-01-10 |website=Tall, Snarky Canadian |language=en-ca |archive-date=2023-01-10 |archive-url=https://web.archive.org/web/20230110140918/https://snarky.ca/how-the-heck-does-async-await-work-in-python-3-5/ |url-status=live }}</ref> [[Melvin Conway]] coined the term ''coroutine'' in 1958 when he applied it to the construction of an [[assembly language|assembly program]].<ref name="KnuthVol1_1_4_5" /> The first published explanation of the coroutine appeared later, in 1963.<ref name="Conway1963"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)