Prev | Current Page 265 | Next

Carl Reynolds and Paul Tymann

"Schaum's Outline of Principles of Computer Science"


Not all, but a significant number of, programs can take advantage of threads. A common example is a word
processor that checks one??™s spelling as one types. One thread attends to the typing at the keyboard, and a second
thread constantly checks to see if the words typed match any of the words in the dictionary. Both threads are
part of the same process; they share access to the same files, the same user, the same memory, etc.
In the case of the word processor, the keyboard thread gets priority, so that the user feels the computer is
quickly responsive to his or her typing. When the computer is waiting for more typing to occur, the ???background???
spell-checking thread can inspect the words for correct spelling. This approach to program design is
referred to as multithreading.
Getting back to the concept of a process, let us consider what the operating system does when one ???runs??? a
program. The operating system creates a table entry for each process running on the machine. Usually the entry
is referred to as a process control block (PCB), but the name for the concept varies among operating systems.
The PCB is used to track all the information about the process, and it includes fields such as the program
name, code location on the disk, priority, state (ready/waiting/running), open files, memory boundaries, parent
process (the process which started the process), user ID, group ID, and storage for the register contents and
program counter value when the process is interrupted.


Pages:
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
Toots Thielemans Patrick Swayze Yann Tiersen System of a Down The Temptations