6 - Processes Flashcards
What is multiprogramming?
OS gives CPU to
another program if current program
must wait on I/O
What is Cooperative Multitasking?
Programs can
voluntarily yield CPU to another program
What is Preemptive Multitasking?
A program gets a fraction of a second to execute, then OS automatically switches to the next program, and so on Almost all modern OSes implement this
What is Multithreading?
allows even more efficient
multitasking, usually preemptive
What is Multitasking?
Concurrent execution of multiple programs
Usually an illusion of parallelism
Can run more processes than there are CPUs
What is the use of Multitasking?
Allows us to reduce CPU idling during I/O
What is a process?
An abstraction of a program in execution.
Is a program the same thing as a process?
NO!
Program is PASSIVE
Process is active
Does a process get its own address space? What is in this address space?
• text section: the program code
• data section: global variables, constant
variables
• heap: memory for dynamic allocation during run time
• stack: temporary data (parameters, return address, local variables)
What is the Process Control Block (PCB)?
A data structure comprising of bits of information needed by the OS for process management.
What are the typical parts of the PCB?
HIGH LEVEL
- Process/Memory/File Management
• process state
• program counter, CPU registers
• priority, pointers to various queues
• memory management info: eg. page tables, segment
tables, etc.
• accounting info: eg. CPU time, timeout values, process
numbers, etc.
• I/O status info: open files, I/O devices, etc.
What is a Process Table?
A collection of all PCBs
Which system call does UNIX define to create a new process?
fork()
What is a Parent Process?
The process that is creating a new process
What is a Child Process?
A newly created process