Lecture 3: Operating System Structures Flashcards
1
Q
Policy vs Mechanism
A
- Policy specifies what needs to be done
- e.g. Which virtual memory page should the OS evict? * e.g. What process should the OS run
next? - Mechanism specifies how to do it
- e.g. how to save dirty pages, how to update the CPU’s page table to
- reflect the page-out/page-in operations, other bookkeeping
- e.g. how to save the current process’ context, how to restore the new process’ contex
2
Q
reasons for cooperating processes
A
- Information sharing: Several processes may need to access
the same data (such as stored in a file.) - Computation speedup: A task can ofter be run faster if it is
broken into subtasks and distributed among different
processes. - Modularity: It may be easier to organize a complex task into
separate subtasks, then have different processes or threads
running each subtask. - Convenience: An individual user can run several programs
at the same time, to perform some task.
3
Q
The two Inter process communication mechanisms
A
Two methods
* Shared memory: shared memory space for two or more process
* Message passing
4
Q
What are signals?
A
- Very short messages
- No arguments only signal number
- Signals serve two main purposes:
- To make a process aware that a specific event has occurred
- To cause a process to execute a signal handler function included in its
code