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
Chrome is multiprocess with 3 different types
- Browser process manages user interface, disk and network I/O
- Render process renders web pages
- Plug in process for each type of plug in
What are the reasons for cooperating process?
- Info sharing
- Computation speed up
- Modularity
- Convenience
What are the two models of IPC?
- Shared Memory
- Message Passing
Describe the difference between Independent and Cooperating processes
- Independent process cannot affect or be affected by the execution of another process
- Cooperating process can affect of be affected by the execution of another process
What is the producer consumer problem?
Paradigm for cooperating processes, producer produces info that is consumer by a consumer process
- Unbounded buffer places no practical limit on the size of the buffer
- Bounded buffer assumes there is a fixed buffer size
what do two processes need to do in order to communicate?
- Establish a communication link between them
- Exchange messages via send/receieve
Implementation of communication link
Physical: Logical:
- Shared memory - Direct or Indirect
- Hardware bus - Synch or Asynch
- Network - Auto or Explicit buffering
What is indirect communication?
- Messages are directed and received from mailboxes
- Each mailbox has a unique ID
- Processes can communicate only if they share a mailbox
Message Passing is considered to be either blocking or nonblocking. Describe Blocking
- blocking is considered synchrounous
- Blocking Send: the sender is blocked until message recieved
- Blocking Recieve: The reciever is blocked until message is available