ch3 - basic Flashcards
Processes (34 cards)
What is the advantage of processes?
Allows multitasking and efficient use of system resources.
What is the disadvantage of processes?
Context switching causes additional performance overhead.
What is a process state?
Indicates the execution state of a process: New, Running, Waiting, Ready, or Terminated.
What is a Process Control Block (PCB)?
A data structure that contains information about a process, such as state, program counter, CPU registers, memory management info, etc.
What is a context switch?
The process where the CPU switches from one process to another by saving and restoring its state.
What is the disadvantage of a context switch?
Context switch time is pure overhead and does not perform useful work.
What is Interprocess Communication (IPC)?
A mechanism that allows processes to share information and coordinate activities.
What are the two main types of IPC?
Shared memory and message passing.
What is a problem with shared memory IPC?
Requires synchronization between processes to prevent race conditions.
What is message passing?
An IPC mechanism where processes exchange information by sending and receiving messages.
What are the advantages of message passing?
Easier synchronization and supports communication across different computers.
What are the disadvantages of message passing?
Slower data transfer compared to shared memory.
What is the Producer-Consumer problem?
A classic IPC problem where one process produces data while another consumes it.
How can the Producer-Consumer problem be solved using shared memory?
By using a counter variable, shared buffers, and synchronization mechanisms.
What is a race condition?
A situation where multiple processes access a shared resource concurrently, leading to inconsistent results.
How can a race condition be prevented?
Using synchronization mechanisms like locks and atomic operations.
What are the disadvantages of multiprocessing?
Complex process management, synchronization requirements, and context switch overhead.
What is a socket?
An endpoint for communication between processes over a network or within the same system.
How are sockets used in client-server communication?
The server listens for requests, and the client sends data and receives responses.
What is Remote Procedure Call (RPC)?
An IPC mechanism that allows calling functions on a remote process as if they were local.
What are the advantages of RPC?
Simplifies process communication and abstracts network communication.
What are the disadvantages of RPC?
Sensitive to network failures and requires data format compatibility between systems.
What is a Named Pipe?
An IPC mechanism that allows bidirectional communication between unrelated processes.
What is a Foreground Process in mobile systems?
An active process controlled via the user interface.