Coroutine - Research Article from World of Computer Science

This encyclopedia article consists of approximately 2 pages of information about Coroutine.

Coroutine - Research Article from World of Computer Science

This encyclopedia article consists of approximately 2 pages of information about Coroutine.
This section contains 442 words
(approx. 2 pages at 300 words per page)
Buy the Coroutine Encyclopedia Article

Coroutines are collections of processes (which execute one at a time) that have the ability to transfer control to (or resume) each other. When control is transferred back to it, each coroutine resumes at the point where it last ended. When a coroutine transfers control, its data value is retained. The retention of data makes coroutines different from subroutines.

A subroutine is called and then upon completion returns; a coroutine resumes. When a subroutine returns, control is transferred to the instruction following the subroutine call and any data in the subroutine is lost. On the next call, the subroutine starts from the beginning and new data is created. Coroutines, however, can call another coroutine and resume at the point immediately following the call and preserve its data.

Coroutines interact in the following way:

  • One coroutine has control until it resumes another coroutine.
  • A coroutine is activated the first...

(read more)

This section contains 442 words
(approx. 2 pages at 300 words per page)
Buy the Coroutine Encyclopedia Article
Copyrights
Gale
Coroutine from Gale. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.