Chapter 3 - Processes Flashcards
What is a process?
A process is program in execution, and the status of the current activity of a process is represented by the program counter, as well as other registers.
How is the layout of a process in memory represented?
The layout of a process in memory is represented by four different sections:
1. text
2. data
3. heap
4. stack
What are the four general states of a process?
- ready
- running
- waiting
- terminated
What is a process control block (PCB)?
A process control block (PCB) is the kernel data structure that represents a process in an operating system.
What is the role of the process scheduler?
The role of the process scheduler is to select an available process to run on a CPU.
When does an operating system perform a context switch?
An operating system performs a context switch when it switches from running one process to running another.
What are the fork() and CreateProcess() system calls used for?
The fork() and CreateProcess() system calls are used to create processes on UNIX and Windows systems, respectively.
What happens when shared memory is used for communication between processes?
When shared memory is used for communication between processes, two (or more) processes share the same region of memory. POSIX provides an API for shared memory.
How can two processes communicate?
Two processes may communicate by exchanging messages with one another using message passing. The Mach operating system uses message passing as its primary form of interprocess communication. Windows provides a form of message passing as well.
What does a pipe provide?
A pipe provides a conduit for two processes to communacte.
What are the forms of pipes?
There are two forms of pipes, ordinary and named. Ordinary pipes are designed for communication between processes that have a parent-child relationship. Named pipes are more general and allow several processes to communicate.
What are the two common forms of client-server communcation?
Two common forms of client-server communication are sockets and remote procedure calls (RPCs). Sockets allow two processes on different machines to communicate over a network. RPCs abstract the concept of function (procedure) calls in such a way that a function can be invoked on another process that may reside on a separate computer.
What does the Android operating system use as a form of interprocess communication?
The Android operating system uses RPCs as a form of interprocess communication using its binder framework.