Process Flashcards
Process
The abstraction of a running program by the OS at any instant in time, separated from other instances.
Virtualization
The operating system provides an illusion to every running computer program that it has exclusive control of the Central Processing Unit (CPU) and memory, while many other programs actually share them; in other words, the OS gives an illusion of an unlimited/excessive supply of CPUs, when in fact there is only one/a few CPUs.
This feature of an OS is known as virtualization.
How is virtualization achieved by an OS? (Define the features)
Time-sharing and space-sharing:
- Time-sharing is a technique used by an OS to share a resource (CPU) among multiple entities (processes) CONCURRENTLY. Actually, one process is run for a while, then stopped, then another is run, and so on. Each process, however, becomes slower; in other words, the potential cost is performance.
- Space-sharing is the counterpart of time-sharing; it is a virtualization technique by the OS where the resource (CPU) is shared by entities (processes) depending on the desired amount of space/memory of the resource.
Running process
A process that is currently being executed by the OS on the CPU.
Ready process
A process that is ready to run but is not running.
Blocked process
A process that is waiting for some moment/event to take place; a process that has performed some kind of operation (e.g. I/O) that makes it interrupted from running until some other event takes place.
What are the states of a process status?
Running, ready, and blocked
Context switch
The ability of an operating system to stop running one program (blocked) and start running another (ready/blocked -> running) on a CPU.
Process Control Block/Process Descriptor
A data structure that contains information about a specific process, such as process state, PID, program counter (PC), CPU registers, CPU scheduling info, PID of parent process, I/O status info, etc.
Differentiate between system call and function call
- system call must run ONLY in KERNEL mode, whereas function call can run in ANY mode
- System call is made by a TRAP instruction, function call is made by a JUMP instruction.
- System call must be registered in the trap table, function call can be put in any memory location.
- System call comes with TWO context switches, function call with only ONE.
How does the OS create a process?
Using system calls, such as fork() (duplicates a process) and exec() (replace the running process with a new one); these 2 system calls (fork and exec) are typically used in combination to create a new process.