e., Ready), Runnable Swapped (i.e., Ready, but the code is on the disk
at the moment because the process was removed from memory in favor of another process), Sleeping in
Memory (i.e., Waiting), and Sleeping Swapped (i.e., Waiting for some event like an I/O completion, and the
code is on the disk so that another process can occupy the memory).
When a process moves out of the Waiting state, it does not go directly to the Running state. Instead, when
the event for which it was waiting occurs, a Waiting process becomes Ready. The OS then chooses from among
the Ready processes one process to run.
THREADS
Modern operating systems often provide the thread model for execution control. Threads allow multiple
lines of execution within a single process. This is much like multiple processes, but without the overhead of
102 OPERATING SYSTEMS [CHAP. 6
managing multiple PCBs, and with the built-in facility for sharing memory and other resources among threads
of the same process. Instead of a PCB, a thread requires a much smaller thread table entry, primarily to provide
storage for register and program counter contents when the OS switches among executing threads.
In an operating system that supports threads (???kernel threads,??? which we will discuss shortly), the object
that gets scheduled, and which gains control of the CPU, is the thread.
Pages:
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280