Podcast
Questions and Answers
What type of information must be saved when an interrupt occurs?
What type of information must be saved when an interrupt occurs?
Which of these is included in CPU-scheduling information?
Which of these is included in CPU-scheduling information?
What happens to a process that issues an I/O request?
What happens to a process that issues an I/O request?
What does accounting information for a process typically include?
What does accounting information for a process typically include?
Signup and view all the answers
What is true about a child process in relation to its parent process?
What is true about a child process in relation to its parent process?
Signup and view all the answers
Under which condition might a parent process terminate its child process?
Under which condition might a parent process terminate its child process?
Signup and view all the answers
What typically happens when the time slice of a process expires?
What typically happens when the time slice of a process expires?
Signup and view all the answers
What is a characteristic of the child process when created?
What is a characteristic of the child process when created?
Signup and view all the answers
What component contains the executable code of a process?
What component contains the executable code of a process?
Signup and view all the answers
Which state indicates that a process is actively executing instructions?
Which state indicates that a process is actively executing instructions?
Signup and view all the answers
What does the program counter in a process control block indicate?
What does the program counter in a process control block indicate?
Signup and view all the answers
In which section of a process is dynamic memory allocated during runtime?
In which section of a process is dynamic memory allocated during runtime?
Signup and view all the answers
Which statement about process states is true?
Which statement about process states is true?
Signup and view all the answers
Which part of the global data section includes initialized and uninitialized data?
Which part of the global data section includes initialized and uninitialized data?
Signup and view all the answers
Which of the following is NOT a state of a process?
Which of the following is NOT a state of a process?
Signup and view all the answers
What is stored in the stack section of a process?
What is stored in the stack section of a process?
Signup and view all the answers
What happens in a zero capacity queue when a message is sent?
What happens in a zero capacity queue when a message is sent?
Signup and view all the answers
In a bounded capacity queue, what occurs if the queue is full when a new message is sent?
In a bounded capacity queue, what occurs if the queue is full when a new message is sent?
Signup and view all the answers
Which type of capacity queue allows an infinite number of messages?
Which type of capacity queue allows an infinite number of messages?
Signup and view all the answers
What is a necessary feature of the message header in Mach Message Passing?
What is a necessary feature of the message header in Mach Message Passing?
Signup and view all the answers
What can happen if a sender attempts to send a message to a full queue?
What can happen if a sender attempts to send a message to a full queue?
Signup and view all the answers
What is the purpose of a section object in Windows for larger messages?
What is the purpose of a section object in Windows for larger messages?
Signup and view all the answers
Which of the following statements about pipes is NOT true?
Which of the following statements about pipes is NOT true?
Signup and view all the answers
What does it mean for a queue to have bounded capacity?
What does it mean for a queue to have bounded capacity?
Signup and view all the answers
What is the primary role of the init (or systemd) process in UNIX and Linux systems regarding process termination?
What is the primary role of the init (or systemd) process in UNIX and Linux systems regarding process termination?
Signup and view all the answers
In a UNIX-like program, how many processes are created by the program if the initial parent process is counted?
In a UNIX-like program, how many processes are created by the program if the initial parent process is counted?
Signup and view all the answers
When is it more suitable to use ordinary pipes over named pipes?
When is it more suitable to use ordinary pipes over named pipes?
Signup and view all the answers
What is a possible consequence of not enforcing 'at most once' or 'exactly once' semantics in RPC?
What is a possible consequence of not enforcing 'at most once' or 'exactly once' semantics in RPC?
Signup and view all the answers
Which method effectively guarantees that a process identifier (pid) is unique for each new process in an operating system?
Which method effectively guarantees that a process identifier (pid) is unique for each new process in an operating system?
Signup and view all the answers
What is a disadvantage of synchronous communication at the system level?
What is a disadvantage of synchronous communication at the system level?
Signup and view all the answers
In which scenario are named pipes more beneficial than ordinary pipes?
In which scenario are named pipes more beneficial than ordinary pipes?
Signup and view all the answers
Which process state indicates that a child process has completed but has not yet been reaped by its parent?
Which process state indicates that a child process has completed but has not yet been reaped by its parent?
Signup and view all the answers
What must be unique among active processes in a system?
What must be unique among active processes in a system?
Signup and view all the answers
What does the function allocate map() return upon unsuccessful execution?
What does the function allocate map() return upon unsuccessful execution?
Signup and view all the answers
In the context of the Collatz conjecture, what happens to the sequence of numbers generated?
In the context of the Collatz conjecture, what happens to the sequence of numbers generated?
Signup and view all the answers
What is the significance of port 17 when connecting to a server?
What is the significance of port 17 when connecting to a server?
Signup and view all the answers
What is the correct syllable structure of a haiku?
What is the correct syllable structure of a haiku?
Signup and view all the answers
What should the haiku server do when a client connects to it?
What should the haiku server do when a client connects to it?
Signup and view all the answers
How does an echo server operate?
How does an echo server operate?
Signup and view all the answers
What function is used to release a pid that is no longer needed?
What function is used to release a pid that is no longer needed?
Signup and view all the answers
Study Notes
Processes
- A process is a program in execution and consists of the following sections:
- Text section: Contains the executable code
- Data section: Stores global variables
- Heap section: Dynamically allocated memory during program runtime
- Stack section: Used for temporary data storage during function calls
- A process can be in one of several states:
- New: The process is being created
- Running: Instructions are being executed
- Waiting: Waiting for an event (e.g., I/O completion)
- Ready: Waiting to be assigned to a processor
- Terminated: Execution has finished
- The Process Control Block (PCB) contains information about a process:
- Process state: New, ready, running, waiting, terminated, etc.
- Program Counter: The address of the next instruction to be executed
-
CPU Registers: Store values needed for process execution
- Accumulators, index registers, stack pointers, general-purpose registers
- These are saved when an interrupt occurs to allow the process to resume correctly
-
CPU Scheduling Information: Priority, scheduling queue pointers, etc.
- Used for managing when and how a process gets to run on the CPU
-
Memory Management Information: Base and limit registers, page tables, segment tables
- Details on how the process's memory is organized
-
Accounting Information: CPU time used, real time used, account numbers
- Used for tracking resource usage
- I/O Status Information: List of allocated I/O devices, open files, etc.
-
Threads are lightweight processes that share the same address space and resources.
- Multiple threads within a process can execute concurrently, enhancing performance.
Process Scheduling
-
Scheduling queues: Processes spend time in different queues:
- Ready queue: Processes waiting to be assigned to a CPU
- I/O wait queue: Processes waiting for I/O to complete
- Wait queue: Processes waiting for an event (e.g., child process termination)
- CPU Scheduling algorithms: Determine which ready process is assigned to the CPU next.
- A context switch is the process of saving the state of the currently running process and loading the state of a new process, allowing the CPU to switch between running processes.
- Context switches involve saving the current process's program counter, CPU registers, and other process state information.
Operations on Processes
-
Process creation: A new process is created, typically by an existing process (the parent).
- The parent can choose to execute concurrently with the child or wait for the child to terminate.
- The child process can be a copy of the parent or have a completely different program loaded.
-
Process termination: A process can be terminated for various reasons:
- The process completes its assigned task.
- The parent process terminates.
- The process exceeds resource limits.
- The process is abnormally terminated.
-
Inter-process communication (IPC): Allows processes to communicate with each other.
- Message passing: Processes exchange messages through shared queues.
- Shared memory: Processes access a shared region of memory to communicate.
- Semaphores: Used for synchronizing access to shared resources, preventing race conditions.
- Pipes: Unidirectional or bidirectional connections between processes.
-
Buffering: Messages are buffered to handle different sending and receiving rates:
- Zero capacity: The sender blocks until the receiver receives the message.
- Bounded capacity: A finite number of messages can be queued, and the sender blocks if the queue is full.
- Unbounded capacity: The queue has potentially infinite length, and the sender never blocks.
Examples of IPC Systems
- POSIX Shared Memory: Provides a standard way to create and access shared memory segments across different processes.
-
Mach Message Passing: A message-passing system that offers a flexible and powerful IPC mechanism.
- Messages include:
- A fixed-size message header with metadata (size, source, destination ports)
- A variable-sized body containing data.
- Sending a message to a full queue can be handled in various ways:
- Wait indefinitely until there is room in the queue.
- Wait for a specified time (milliseconds).
- Return immediately without waiting.
- Temporarily cache the message, notifying the sender when the queue has space.
- Messages include:
- Windows: Uses a combination of message queues, shared memory (sections), and direct memory access for IPC.
Pipes
-
Pipes: Allow processes to communicate unidirectionally or bidirectionally.
- Ordinary pipes: A temporary communication channel between related processes.
- Named pipes: Persistent channels that can be accessed by any process on the system.
Additional Notes
- Init (or Systemd) Process: The init process (or systemd) is responsible for starting up and managing system processes on Unix and Linux systems. It also handles process termination, ensuring that orphaned processes are properly terminated.
- Zombie Processes: A zombie process is a process that has completed execution but its entry in the process table still exists because the parent process hasn't yet called wait() to reclaim its resources.
- RPC (Remote Procedure Call): A mechanism that allows a process on one computer to call a procedure/function on a process running on another computer. Guaranteeing at-least-once, at-most-once, or exactly-once semantics for RPC calls is crucial for reliable communication.
- Echo server: A simple server that echoes back any data it receives from a client.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Explore the intricacies of processes in operating systems with this quiz. Understand the different sections of a process, various process states, and the important role of the Process Control Block (PCB). Test your knowledge on key concepts and terminology in this essential topic.