z-logo
Premium
Implementing a simulation tool in a high‐level language with no multitasking facilities
Author(s) -
Cavouras John C.
Publication year - 1983
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.4380130907
Subject(s) - pascal (unit) , computer science , programming language , human multitasking , variable (mathematics) , block (permutation group theory) , arithmetic , parallel computing , mathematics , psychology , mathematical analysis , geometry , cognitive psychology
Ways to implement coroutines in a block‐structured language with no multitasking facilities are presented. Coroutines are implemented as procedures. The reactivation points are kept in global variables, one variable for each procedure. Local variables whose values are required on re‐entry are stored as STATIC objects. The variables or data of re‐entrant coroutines are stored in an event list associated with each such coroutine. A procedure with several entries is a convenient mechanism to trap the primitive calls issued by the coroutines. This procedure returns to the master program by using a non‐local GOTO. The implementation of the above in PL/I and C is described and a comparison is made with sequential Pascal. Ada includes constructs which satisfy most requirements.

This content is not available in your region!

Continue researching here.

Having issues? You can contact us here