Serial and Parallel Code
Serial code uses a single thread of execution working on a single data item at any one time. Sorting cards using one worker is an example of serial computation. Some parts of a parallel program may still be serial code. For instance, when the manager was partitioning the data by card suit, this was like a serial code section because none of the workers could start until the partitioning was done.
Parallel code has more than one thing happening at a time. In our card sorting example, this corresponds to having multiple workers active at once. In computing this could be:
- Multiple threads of execution in a single process (Multiple card sorters working at one table).
- Multiple processes all working on the same problem (Multiple workers, each at their own table).
- A single thread of execution operating on multiple data items simultaneously (e.g., by issuing vector instructions on a CPU).
- Any combination of the above.

©
|
Cornell University
|
Center for Advanced Computing
|
Copyright Statement
|
Access Statement
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)
CVW material development is supported by NSF OAC awards 1854828, 2321040, 2323116 (UT Austin) and 2005506 (Indiana University)