unit 2 Flashcards
What is a process?
A program in execution; process execution must progress in sequential fashion.
What are the multiple parts of a process?
- Program code (text section)
- Current activity (program counter, processor registers)
- Stack (temporary data, function parameters, return addresses, local variables)
- Data section (global variables)
- Heap (dynamically allocated memory during runtime)
What is the difference between a program and a process?
A program is a passive entity stored on disk (executable file), while a process is an active entity that is loaded into memory.
What are the five states a process can be in?
- New
- Running
- Waiting
- Ready
- Terminated
What is a Process Control Block (PCB)?
Information associated with each process, including process state, program counter, CPU registers, scheduling information, memory-management information, accounting information, and I/O status information.
What is the role of the short-term scheduler?
Selects which process should be executed next and allocates CPU.
What is the difference between I/O-bound and CPU-bound processes?
- I/O-bound process: spends more time doing I/O than computations, many short CPU bursts
- CPU-bound process: spends more time doing computations, few very long CPU bursts
What happens during a context switch?
The system saves the state of the old process and loads the saved state for the new process.
What are the two main operations provided for interprocess communication (IPC)?
- send(message)
- receive(message)
What are the two models of IPC?
- Shared memory
- Message passing
What is a socket in the context of client-server communication?
An endpoint for communication, defined as a concatenation of IP address and port.
What is remote procedure call (RPC)?
Abstraction for procedure calls between processes on networked systems, using ports for service differentiation.
What are the two types of pipes used for interprocess communication?
- Ordinary pipes
- Named pipes
What are the benefits of multithreading in modern applications?
- Responsiveness
- Resource sharing
- Economy
- Scalability
What is the difference between concurrency and parallelism?
- Concurrency: supports more than one task making progress
- Parallelism: implies a system can perform more than one task simultaneously
What are the four multithreading models?
- Many-to-One
- One-to-One
- Many-to-Many
- Two-Level
What is a thread library?
Provides an API for creating and managing threads.
What is the purpose of a thread pool?
Creates a number of threads that await work, allowing for faster servicing of requests.
What is Grand Central Dispatch?
Apple technology for managing threading in Mac OS X and iOS, allowing identification of parallel sections.
What are the two types of threads in the context of thread management?
- User threads
- Kernel threads
What is a signal handler?
Used to process signals generated by particular events in UNIX systems.
Fill in the blank: A process executes the last statement and then asks the operating system to delete it using the _______ system call.
exit()
True or False: A child process can exist if its parent process has terminated in all operating systems.
False