Podcast
Questions and Answers
What is the primary function of a process in an operating system?
What is the primary function of a process in an operating system?
- To execute instructions in a sequential manner (correct)
- To store data variables permanently
- To simply hold program code on disk
- To allocate memory for the operating system
Which section of a process's memory is primarily used for dynamic memory allocation?
Which section of a process's memory is primarily used for dynamic memory allocation?
- Heap (correct)
- Text section
- Stack
- Data section
Which process state indicates that the process is waiting for some event to occur?
Which process state indicates that the process is waiting for some event to occur?
- Waiting (correct)
- Running
- Terminated
- Ready
What does the Process Control Block (PCB) NOT include information about?
What does the Process Control Block (PCB) NOT include information about?
What is stored in the Text section of a process's memory?
What is stored in the Text section of a process's memory?
Which term refers to the unique identification number assigned to each process in the operating system?
Which term refers to the unique identification number assigned to each process in the operating system?
In which state is a process when it is ready to execute but not yet assigned to a processor?
In which state is a process when it is ready to execute but not yet assigned to a processor?
Which information is related to how long resources are allocated to a process?
Which information is related to how long resources are allocated to a process?
What is the primary role of a long-term scheduler in process management?
What is the primary role of a long-term scheduler in process management?
Which queue holds processes that are blocked due to unavailable I/O devices?
Which queue holds processes that are blocked due to unavailable I/O devices?
What does a short-term scheduler primarily do?
What does a short-term scheduler primarily do?
In which queue are new processes initially placed?
In which queue are new processes initially placed?
What is the main objective of the job scheduler regarding job types?
What is the main objective of the job scheduler regarding job types?
Which statement best describes a good process in the context of a long-term scheduler?
Which statement best describes a good process in the context of a long-term scheduler?
Which of the following is NOT a function of the process scheduling system?
Which of the following is NOT a function of the process scheduling system?
What structure is used to implement the ready queue?
What structure is used to implement the ready queue?
What role does medium-term scheduling play in the management of processes?
What role does medium-term scheduling play in the management of processes?
What does the fork() system call do in process management?
What does the fork() system call do in process management?
In process creation, what defines the relationship between a parent process and a child process?
In process creation, what defines the relationship between a parent process and a child process?
What happens to processes when the ready queue is empty?
What happens to processes when the ready queue is empty?
What does the term 'Address Space' refer to in context with processes?
What does the term 'Address Space' refer to in context with processes?
Which statement is true about how parent and child processes execute?
Which statement is true about how parent and child processes execute?
If the fork() system call returns a negative value, what does it indicate?
If the fork() system call returns a negative value, what does it indicate?
What is a key characteristic of the resources shared between a parent and child process?
What is a key characteristic of the resources shared between a parent and child process?
What is the primary function of Process Scheduling?
What is the primary function of Process Scheduling?
What occurs during a context switch?
What occurs during a context switch?
Which of the following is NOT a characteristic of context switching?
Which of the following is NOT a characteristic of context switching?
In which scenario does pre-emptive scheduling occur?
In which scenario does pre-emptive scheduling occur?
What is a direct cost of context switching?
What is a direct cost of context switching?
Process Control Blocks (PCBs) hold information regarding which of the following?
Process Control Blocks (PCBs) hold information regarding which of the following?
Which of the following reflects a characteristic of non-preemptive scheduling?
Which of the following reflects a characteristic of non-preemptive scheduling?
Why should the frequency of context switching be limited?
Why should the frequency of context switching be limited?
What does the fork() system call return to the parent process?
What does the fork() system call return to the parent process?
What is one reason a parent process may terminate its child processes?
What is one reason a parent process may terminate its child processes?
Which function allows a parent process to block until a child terminates?
Which function allows a parent process to block until a child terminates?
What happens to a child process if its parent terminates without waiting?
What happens to a child process if its parent terminates without waiting?
What is a characteristic of a zombie process?
What is a characteristic of a zombie process?
What may cause a system to terminate processes?
What may cause a system to terminate processes?
What does the exit() function do in relation to process termination?
What does the exit() function do in relation to process termination?
When does cascading termination occur?
When does cascading termination occur?
Flashcards are hidden until you start studying
Study Notes
Process Concept
- A process is an active instance of a program, unlike a program which is passive and stored on disk.
- Key components of a process include the program counter, stack, and data section.
- Process execution follows a sequential order.
Process Memory Structure
- Memory for a process is divided into four sections:
- Text Section: Contains the compiled program code.
- Data Section: Holds global and static variables.
- Heap: Used for dynamic memory allocation.
- Stack: Stores local variables.
Process States
- Processes change states during execution:
- New: The process is being created.
- Ready: The process is ready to execute but waiting for CPU.
- Running: Instructions are actively being executed.
- Waiting: The process is waiting for an event or resource.
- Terminated: The process has finished execution.
Process Control Block (PCB)
- The PCB contains essential information for managing a process, including:
- Process state and pointer to the parent process.
- Program counter for the next instruction.
- Unique process identifier (PID) and CPU registers.
- Scheduling information including process priority.
- Memory management and accounting details.
- I/O status with a list of devices allotted to the process.
Context Switch
- A context switch involves saving the state of the current process and loading the state of a new process.
- The context is represented in the PCB and includes CPU registers and memory management data.
- Context switching incurs overhead and can take between 1 to 1000 microseconds, impacting overall system efficiency.
Process Scheduling
- Process scheduling determines which process in the ready state should move to running.
- Aims for maximal CPU utilization and minimal response time for programs.
- Types of scheduling:
- Non-pre-emptive: The running process voluntarily yields the CPU.
- Pre-emptive: The OS interrupts a running process to give CPU to another.
Scheduling Queues
- PCBs are maintained in various scheduling queues:
- Job Queue: Contains all processes in the system.
- Ready Queue: Holds processes ready for execution in main memory.
- Device Queues: Contains blocked processes awaiting I/O device availability.
Schedulers
- Special system software responsible for process scheduling, categorized into:
- Long-Term Scheduler (Job Scheduler): Controls the admission of processes into the system and manages multiprogramming degree.
- Short-Term Scheduler (CPU Scheduler): Allocates CPU to ready processes and operates frequently.
- Medium-Term Scheduler: Manages swapping processes to control the degree of multiprogramming.
Process Creation
- Involves parent processes creating child processes, forming a hierarchical structure.
- Each process is assigned a PID and retains the parent PID for reference.
- Processes can share resources or operate independently based on design.
Fork and Execution
- The
fork()
system call creates child processes; its return value indicates success or failure. - Parent processes can either wait for child termination or run concurrently.
- A child process may be a duplicate of its parent or have a new program loaded.
Process Termination
- Processes terminate by executing the last statement and invoking the
exit()
system call, releasing resources. - A parent process can abort child processes under specific conditions.
- Processes may also terminate due to system constraints or intervention.
- Orphan and zombie processes arise from improper terminations; orphans are managed by the
init
system process, while zombies are cleaned up post-parent termination.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.