CS 3304: Comparative Languages
Subprograms
[
Course Documents
] : [
Subprograms
]
Previous
Contents
Next
Keyword Index
Coroutines
A
coroutine
is a subprogram that has multiple entries and controls them itself
Also called
symmetric control
A coroutine call is named a
resume
The first resume of a coroutine is to its beginning, but subsequent calls enter at the point just after the last executed statement in the coroutine
Typically, coroutines repeatedly resume each other, possibly forever
Coroutines provide quasiconcurrent execution of program units (the coroutines)
Their execution is interleaved, but not overlapped