Podcast
Questions and Answers
In a system employing ______, multiple CPUs or microprocessors work together to execute multiple processes simultaneously, enhancing overall system performance.
In a system employing ______, multiple CPUs or microprocessors work together to execute multiple processes simultaneously, enhancing overall system performance.
multiprocessing
Unlike a program, which is a passive entity stored on disk, a ______ is an active entity representing a program in execution, complete with its own execution context and resources.
Unlike a program, which is a passive entity stored on disk, a ______ is an active entity representing a program in execution, complete with its own execution context and resources.
process
The ______ within a process's memory space dynamically manages memory allocation for variables, adjusting its size based on the demands of function calls and returns.
The ______ within a process's memory space dynamically manages memory allocation for variables, adjusting its size based on the demands of function calls and returns.
heap
Stored within the PCB, the ______ acts as a pointer, directing the CPU to the next instruction to be executed within the process's code.
Stored within the PCB, the ______ acts as a pointer, directing the CPU to the next instruction to be executed within the process's code.
The PCB stores details of all related to a process, including its current state, unique identification number, and memory management ______.
The PCB stores details of all related to a process, including its current state, unique identification number, and memory management ______.
When a process transitions to the ______ state, it signifies that the process has completed its execution and is no longer active in the system.
When a process transitions to the ______ state, it signifies that the process has completed its execution and is no longer active in the system.
Compared to a batch system, a ______ is designed to handle multiple interactive user programs or tasks, providing timely responses to user inputs.
Compared to a batch system, a ______ is designed to handle multiple interactive user programs or tasks, providing timely responses to user inputs.
In contrast to initialized ______, uninitialized ______ such as int x;
in a C program, reside in a specific section of memory within a running process.
In contrast to initialized ______, uninitialized ______ such as int x;
in a C program, reside in a specific section of memory within a running process.
The three types of process scheduling queues are the job queue, which contains all processes in the system; the ready queue, which contains processes loaded in main memory; and the ______ queue, which contains processes waiting for I/O.
The three types of process scheduling queues are the job queue, which contains all processes in the system; the ready queue, which contains processes loaded in main memory; and the ______ queue, which contains processes waiting for I/O.
The ______-term scheduler, also known as the CPU scheduler, decides which process should execute next and allocates the CPU, operating at a fast pace measured in milliseconds.
The ______-term scheduler, also known as the CPU scheduler, decides which process should execute next and allocates the CPU, operating at a fast pace measured in milliseconds.
Invoked infrequently and operating at a slower pace (seconds or minutes), the ______-term scheduler selects which processes to load into the ready queue for execution.
Invoked infrequently and operating at a slower pace (seconds or minutes), the ______-term scheduler selects which processes to load into the ready queue for execution.
The ______-term scheduler reduces the degree of multiprogramming by swapping processes in and out of memory to manage the memory load and create space in RAM.
The ______-term scheduler reduces the degree of multiprogramming by swapping processes in and out of memory to manage the memory load and create space in RAM.
If a system contains only I/O bound processes, the ready queue will be empty, leading to ______ utilization of the CPU as I/O processes spend more time waiting.
If a system contains only I/O bound processes, the ready queue will be empty, leading to ______ utilization of the CPU as I/O processes spend more time waiting.
The time spent on the process of switching between different processes is known as time ______, and it doesn't contribute to useful work.
The time spent on the process of switching between different processes is known as time ______, and it doesn't contribute to useful work.
In the process state diagram, the transition from the 'Ready' state to the 'Running' state is triggered by the ______ dispatch.
In the process state diagram, the transition from the 'Ready' state to the 'Running' state is triggered by the ______ dispatch.
A process that spends more time waiting for I/O and has short CPU bursts is known as an ______ bound process.
A process that spends more time waiting for I/O and has short CPU bursts is known as an ______ bound process.
A process that spends more time doing computations and has few but long CPU bursts is considered a ______ bound process.
A process that spends more time doing computations and has few but long CPU bursts is considered a ______ bound process.
When a process is in the 'Running' state and an interrupt occurs, it transitions back to the ______ state.
When a process is in the 'Running' state and an interrupt occurs, it transitions back to the ______ state.
[Blank] switching involves saving the state of the current process into its PCB and loading the state of the new process from its PCB to start execution.
[Blank] switching involves saving the state of the current process into its PCB and loading the state of the new process from its PCB to start execution.
Processes are identified and managed by the operating system using a unique ______ (Process Identifier).
Processes are identified and managed by the operating system using a unique ______ (Process Identifier).
In process creation, parent and child processes can be configured such that they do not share any resources, resulting in ______ resources for both.
In process creation, parent and child processes can be configured such that they do not share any resources, resulting in ______ resources for both.
When a child process terminates and returns its status to the parent by calling the exit system call, the OS ______ resources allocated to the child.
When a child process terminates and returns its status to the parent by calling the exit system call, the OS ______ resources allocated to the child.
If a child process exceeds its allocated resources or the task assigned to it is no longer needed, the parent process can terminate the child by calling the ______ system call.
If a child process exceeds its allocated resources or the task assigned to it is no longer needed, the parent process can terminate the child by calling the ______ system call.
A child process that terminates but whose parent has not yet called wait
on it becomes a ______ process.
A child process that terminates but whose parent has not yet called wait
on it becomes a ______ process.
Cooperating processes require a mechanism for __________, which enables them to exchange data and synchronize actions.
Cooperating processes require a mechanism for __________, which enables them to exchange data and synchronize actions.
In the __________ model of interprocess communication, cooperating processes communicate by reading and writing to a shared region of memory.
In the __________ model of interprocess communication, cooperating processes communicate by reading and writing to a shared region of memory.
__________ is an interprocess communication model that uses system calls to exchange data, and is often used for communication across multiple systems.
__________ is an interprocess communication model that uses system calls to exchange data, and is often used for communication across multiple systems.
__________ communication requires processes to explicitly name the sender or receiver, creating a direct link between the communicating processes.
__________ communication requires processes to explicitly name the sender or receiver, creating a direct link between the communicating processes.
__________ communication involves the use of mailboxes or ports through which processes send and receive messages, allowing for more flexible communication patterns.
__________ communication involves the use of mailboxes or ports through which processes send and receive messages, allowing for more flexible communication patterns.
A __________ send operation blocks the sender until the message is received, ensuring that the data has been successfully transmitted before the sender continues.
A __________ send operation blocks the sender until the message is received, ensuring that the data has been successfully transmitted before the sender continues.
In a rendezvous, both the send
and receive
operations are __________, meaning both the sender and receiver are blocked until the message is successfully transmitted.
In a rendezvous, both the send
and receive
operations are __________, meaning both the sender and receiver are blocked until the message is successfully transmitted.
A __________ send operation allows the sender to continue processing immediately after sending the message, without waiting for confirmation of receipt.
A __________ send operation allows the sender to continue processing immediately after sending the message, without waiting for confirmation of receipt.
Flashcards
Uniprogramming
Uniprogramming
One process loaded into RAM.
Multiprogramming
Multiprogramming
Multiple processes loaded into RAM.
Multitasking
Multitasking
Multiple processes executing in RAM from different users, seemingly simultaneously.
Multiprocessing
Multiprocessing
Signup and view all the flashcards
Multithreading
Multithreading
Signup and view all the flashcards
Process
Process
Signup and view all the flashcards
PCB (Process Control Block)
PCB (Process Control Block)
Signup and view all the flashcards
Process State
Process State
Signup and view all the flashcards
Process Scheduling Queues
Process Scheduling Queues
Signup and view all the flashcards
Types of Process Scheduling Queues
Types of Process Scheduling Queues
Signup and view all the flashcards
Types of Process Schedulers
Types of Process Schedulers
Signup and view all the flashcards
Short-Term Scheduler
Short-Term Scheduler
Signup and view all the flashcards
Long-Term Scheduler
Long-Term Scheduler
Signup and view all the flashcards
Medium-Term Scheduler
Medium-Term Scheduler
Signup and view all the flashcards
I/O-Bound Process
I/O-Bound Process
Signup and view all the flashcards
CPU-Bound Process
CPU-Bound Process
Signup and view all the flashcards
Time Overhead (Context Switching)
Time Overhead (Context Switching)
Signup and view all the flashcards
New State
New State
Signup and view all the flashcards
Ready State
Ready State
Signup and view all the flashcards
Running State
Running State
Signup and view all the flashcards
Terminated State
Terminated State
Signup and view all the flashcards
Waiting State
Waiting State
Signup and view all the flashcards
PID (Process Identifier)
PID (Process Identifier)
Signup and view all the flashcards
Zombie Process
Zombie Process
Signup and view all the flashcards
Cooperating Process
Cooperating Process
Signup and view all the flashcards
Interprocess Communication (IPC)
Interprocess Communication (IPC)
Signup and view all the flashcards
Shared Memory
Shared Memory
Signup and view all the flashcards
Message Passing
Message Passing
Signup and view all the flashcards
Direct Communication
Direct Communication
Signup and view all the flashcards
Indirect Communication
Indirect Communication
Signup and view all the flashcards
Blocking (Synchronous) Communication
Blocking (Synchronous) Communication
Signup and view all the flashcards
Non-blocking (Asynchronous) Communication
Non-blocking (Asynchronous) Communication
Signup and view all the flashcards
Study Notes
- Process scheduling involves moving processes between ready and running states.
- Processes in the ready state wait in a queue for the scheduler to dispatch them for execution.
Key Process Terms
- Uniprogramming: A process is loaded into RAM
- Multiprogramming: Multiple processes are loaded into RAM
- Multitasking: Multiple processes from different users execute in RAM
- Multiprocessing: Multiple CPUs or microprocessors execute multiple processes
- Multithreading: One process contains multiple threads
- Batch System: Operating systems execute different types of programs, referred to as "jobs."
- Time-Shared System: Operating systems handle user programs or tasks
Process Definition
- A process is a program in execution, executing sequentially.
- Job queue contains all processes in the system, whether in memory or on disk
- Ready queue contains processes loaded in main memory and waiting to be dispatched, staying there until the scheduler dispatches them
- Device queue contains processes waiting for I/O.
Process States
- New: A new process enters the ready queue
- Ready: It stays in the queue ventis schedular dispatch for execution
- Running: After the I/O request, it's put in the device queue
- Waiting: After the VO is completed and ready queue
- Terminated
Program vs. Process
- A program is passive and stored on disks as an executable file.
- A process becomes active when loaded into memory
- Programs are executed using GUI, mouse clicks, or command-line entry.
- A program can have multiple processes.
Process Components
- A process in memory contains several parts: stack, heap, initialized data, uninitialized data, and text.
- Stack stores local variables and parameters in function calls temporarily.
- Heap dynamically allocates memory for local variables stored in the stack.
- Initialized data stores global variables such as "int x = 15;"
- Uninitialized data stores uninitialized variables, such as "int x;"
- Text stores the program code.
- Stack and heap dynamically grow and shrink based on calls and returns during runtime.
Process Control Block (PCB)
- The PCB stores all information about a process and helps execute it efficiently, also called tast control block
- CPU registers store process-specific data.
- CPU scheduling information includes priority and scheduling data.
- Process state indicates whether the process is running, waiting, etc.
- Process number provides a unique identifier for the process.
- Program counter shows the location of the next instruction to be executed.
- Memory limits define memory allocated to the process.
- Accounting information tracks CPU usage, clock time, and time limits.
- I/O status information tracks I/O devices allocated to the process and a list of open files.
Process Schedulers
- Short-term (CPU scheduler) decides which process should execute next and allocates the CPU; it's fast (milliseconds) and invoked frequently.
- Long-term (Job scheduler) selects which processes to put in the ready queue; it's slow (seconds, minutes) and infrequently invoked.
- Medium-term decreases the degree of multiprogramming by swapping, which involves removing a process from memory, storing it on disk, and bringing it back to continue execution to decrease memory load.
Process Types
- I/O bound process spends more time waiting for I/O and has short CPU bursts.
- CPU bound process spends more time doing computations and has a few long CPU bursts.
Context Switching
- Context switching involves the CPU saving the state of the current process into its PCB and loading the state of the new process from its PCB to start executing.
- The time taken for context switching is overhead and doesn't perform useful work.
- More complex OS and PCBs take longer for context switching.
Balancing I/O and CPU Bound Processes
- Having only I/O bound processes results in an empty ready queue and low CPU utilization
- Having only CPU bound processes overloads the ready queue and underutilizes the I/O queue, resulting in high CPU utilization
Process Operations: Creation
- Parent processes create children processes, forming a tree structure identified and managed using process identifiers (PIDs).
- Resource sharing can occur where parents and children share all, some, or no resources
- Execution can be concurrent where multitasking is needed
- Children can duplicate the parent's address space or have a new program loaded into it
Process Operations: Termination
- Processes terminate by calling the exit system call, notifying the OS to deallocate resources.
- A child process returns its status to the parent process upon exiting.
- Parent processes can terminate children using the abort system call if the child exceeds allocated resources, the task is no longer needed, or the parent exits
- Orphan processes occur when the parent terminates without invoking the wait call.
Interprocess Communication (IPC)
- Independent processes cannot affect or be affected by other processes.
- Cooperating processes can affect and be affected by others due to modularity, computation speedup, convenience, and information sharing.
- IPC facilities include shared memory and message passing
- Shared memory communication involves multiple cooperating processes communicating through a shared memory region faster, controlled by the user, and not the OS
- Message passing involves cooperating processes exchanging data, implemented easily over multiple systems
- Message sizes can be fixed or variable and use send and receive message functions over communication links.
Communication Links
Direct Communication
- Processes must explicitly know each other's names for sending and receiving
- Links are automatically established, associated with one pair, and can be unidirectional or bidirectional
Indirect Communication
- Processes communicate through mailboxes (ports) with unique IDs.
- Links are established through shared mailboxes, can be associated with several processes, and can be unidirectional or bidirectional.
Synchronization
- Blocking (synchronous) sends block the sender until the message is received
- Non-blocking (asynchronous) sends allow the sender to send the message and continue without waiting.
- Blocking receives block the receiver until a message is available
- Non-blocking receives allow the receiver to receive a valid or NULL message if none is waiting
- Buffering involves a queue of messages attached to a link, implemented with zero capacity (sender waits), bounded capacity (sender waits if full), or unbounded capacity (sender never waits).
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.