Processes Flashcards
What is a process?
A process is a program in execution
True or False…
Process execution must progress in sequential fashion?
True
(No parallel execution of instructions of a single process)
What is a program and how does it become a process?
A program is a passive entity on a disk (an executable file). It becomes a process when the executable file is loaded into memory.
Can be started via GUI mouse clicks, command line entry of its name, or another way.
One program can be several processes.
As a process executes, it changes state. What are the five process states?
New: The process is being created,
Running: Instructions are being executed,
Waiting: The process is waiting for some event to occur,
Ready: The process is waiting to be assigned to a processor,
Terminated: The process has finished execution.
What is a process control block?
(PCB)
Contains information associated with each process
(AKA Task Control Block)
What are the names of the seven data stored in the PCB?
Process state, program counter, CPU registers, CPU scheduling information, memory-management information, I/O status information, accounting information.
What is the process state?
What state the process is in; running, waiting, etc.
(Information in the PCB)
What is the program counter?
Contains the location of the instruction to execute next.
(Information in the PCB)
What are CPU registers?
Contents of all process-centric registers.
(Information in the PCB)
What is CPU scheduling information?
Priority, scheduling queue.
(Information in the PCB)
What is I/O status information.
I/O devices allocated to process, lsit of open files.
(Information in the PCB)
What is accounting information?
CPU used, clock time elapsed since start.
(Information in the PCB)
What is process scheduling?
The process scheduler selects among available processes for next execution on CPU core in order to maximise CPU use.
Maintains scheduling queues of processes. Ready queue and wait queues.
What is a context switch and how does it work?
A context switch occurs when the CPU switches from one process to another. The state of the first process is saved into the PCB, and the second process is reloaded from the PCB so the second process can begin executing. The same is done in reverse if the first process needs to be executed.