Chapter 5 Flashcards
What are the multiple parts to a process
- The program code
- Current activity including program counter and process registers
- Stack containing temporary data
- Data section containing global variables
- Heap containing memory dynamically allocated during run time
When does a program become a process?
When the exe file is loaded into memory
What are the states associated with program execution?
- New
- Running
- Waiting
- Ready
- Terminated
What is a process?
A program in execution
What is a Short term Scheduler?
It selects which process should be executed next and allocates CPU. It is invoked frequently
What is a Long Term Scheduler?
it selects which processes should be brought into the ready queue. It is invoked infrequently.
- It controls the degree of multiprogramming
Processes can be described as either:
- I/0 bound process: Spends more time doing I/0 than computations. Many short CPU bursts
- CPU bound process: Spends more time doing computations. Few very long CPU bursts
IOS provides:
- Single foreground processes ( Controlled via user interface)
- Multiple background processes ( in memory, running but not on display, and with limits.
Android uses both of the above
List the resource sharing options
- Parent and children share all resources
- Children share subset of parent’s resources
- Share no resources
List the execution options
- Parent and children execute concurrently
- Parent wait until children terminate
list unix process examples
- fork() system call creates new process
- exec() call used after fork() to replace the process’ memory space with a new program
Process Termination
Process executes last statement and then asks the operating system to delete it using the exit() system call
- returns status data from child to prevent (via wait())
- Process’ resources are deallocated by the os
Parent may terminate the execution of children processes using the abort() system call. What are the reasons for doing so?
- Child has exceed the allocated resources
- Task assigned to the child is no longer required
- The parent is exiting and the operating system does not allow a child to continue if the parent terminates
What is Cascading termination?
- All children, grandchildren etc. are terminated
- The termination is initiated by the OS
What happens if a parent is terminated without invoking wait()?
The process becomes an orphan