multitasking

multitasking is a strategy in which a program performs multiple tasks concurrently.

See Also

inter-process communication
Communication mechanisms leveraged in many multitasking scenarios.

Description

In a multitasking design, a program splits its activity logically into tasks that could be performed concurrently, and then operates as if they actually were being performed that way. Even if in reality these tasks are only interleaved to give the appearance of being performed concurrently, a multitasking design can improve the organization and readability of the program.

Tactics

A multi-tasking design includes some combination of the following things.

coroutines
Modern Tcl interpreters allow multiple call stacks, and provide mechanisms for call stacks to pass control to each other, for cooperative multitasking.
Event Processing
Using a loop to detect and respond to events.
program execution
Using commands such as exec or open to execute other programs, and possibly also communicate with them.
threads
Each thread supports one Tcl interpreter, and all interpreters runs concurrently.