GATE / CS ARCHIVE

GATE CSE 1994 / QUESTION 17(a)

Coroutines and subroutines

Compiler Design · Runtime Environments & Parameter Passing · Full GATE CSE 1994 paper

GATE 1994, Q17(a) Descriptive
Report issue

Runtime Environments & Parameter Passing

Question 17(a), GATE 1994: State true or false with reason: A coroutine is just another name for a subroutine.
Question 17(a), GATE 1994: State true or false with reason: A coroutine is just another name for a subroutine.
Tap to enlarge
Answer & solution

Answer: False. (no official key was published)

1. An ordinary subroutine is entered by a call and returns control to its caller; a fresh call normally begins execution at its entry point.

2. A coroutine can suspend at a yield/resume point, preserve its execution context, and later continue from that point. Control may transfer cooperatively between peer coroutines.

3. One can implement coroutines using lower-level mechanisms, but the two terms do not name the same control-flow abstraction.

Original paper, page 6