<aside> <img src="/icons/map-pin_gray.svg" alt="/icons/map-pin_gray.svg" width="40px" /> Before starting Week 4, the prof expanded on more scheduling algorithms relating to Week 2, where we previously only covered FIFO.

Scheduling Algorithms

</aside>

Multithreading

The discussion so far has presented the concept of a process as embodying two characteristics.

  1. Resource ownership: A process includes a virtual address space to hold the process image.

  2. Scheduling/execution: The execution of a process follows an execution path (trace) through one or more programs.

    Figure 4.1 Program flow of control without and with interrupts.

    Figure 4.1 Program flow of control without and with interrupts.

To distinguish the two characteristics between a process and a thread:

Multithreading refers to the ability of an OS to support multiple, concurrent paths of execution within a single process.

Figure 4.2 Processes and threads.

Figure 4.2 Processes and threads.

The two arrangements shown in the left half are single-threaded approaches, such as MS-DOS. The right half depicts multithreaded approaches, such as Java runtime environment. Each thread has the following:

The key benefits of threads derive from the performance implications:

  1. Less time to create a new thread or terminate a thread than a process.