Processes Chapter Quiz
40 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

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?

  • Heap (correct)
  • Text section
  • Stack
  • Data section
  • 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?

    <p>Registered user name</p> Signup and view all the answers

    What is stored in the Text section of a process's memory?

    <p>Compiled program code</p> Signup and view all the answers

    Which term refers to the unique identification number assigned to each process in the operating system?

    <p>Process Number</p> Signup and view all the answers

    In which state is a process when it is ready to execute but not yet assigned to a processor?

    <p>Ready</p> Signup and view all the answers

    Which information is related to how long resources are allocated to a process?

    <p>Accounting information</p> Signup and view all the answers

    What is the primary role of a long-term scheduler in process management?

    <p>It controls the degree of multiprogramming.</p> Signup and view all the answers

    Which queue holds processes that are blocked due to unavailable I/O devices?

    <p>Device queue</p> Signup and view all the answers

    What does a short-term scheduler primarily do?

    <p>It allocates CPU to selected processes.</p> Signup and view all the answers

    In which queue are new processes initially placed?

    <p>Job queue</p> Signup and view all the answers

    What is the main objective of the job scheduler regarding job types?

    <p>To provide a balanced mix of I/O bound and CPU bound jobs.</p> Signup and view all the answers

    Which statement best describes a good process in the context of a long-term scheduler?

    <p>A process that integrates both I/O bound and CPU bound characteristics.</p> Signup and view all the answers

    Which of the following is NOT a function of the process scheduling system?

    <p>Control the input and output operations of processes.</p> Signup and view all the answers

    What structure is used to implement the ready queue?

    <p>Linked List</p> Signup and view all the answers

    What role does medium-term scheduling play in the management of processes?

    <p>It is part of swapping and helps to reduce the degree of multiprogramming.</p> Signup and view all the answers

    What does the fork() system call do in process management?

    <p>Creates a new process and returns the process ID.</p> Signup and view all the answers

    In process creation, what defines the relationship between a parent process and a child process?

    <p>The parent process creates one or more child processes.</p> Signup and view all the answers

    What happens to processes when the ready queue is empty?

    <p>Processes can still be swapped in from secondary memory.</p> Signup and view all the answers

    What does the term 'Address Space' refer to in context with processes?

    <p>The range of addresses accessible to a processor or reserved for a process.</p> Signup and view all the answers

    Which statement is true about how parent and child processes execute?

    <p>Parent and child processes execute concurrently by default.</p> Signup and view all the answers

    If the fork() system call returns a negative value, what does it indicate?

    <p>The creation of a child process was unsuccessful.</p> Signup and view all the answers

    What is a key characteristic of the resources shared between a parent and child process?

    <p>The child process inherits all resources of the parent.</p> Signup and view all the answers

    What is the primary function of Process Scheduling?

    <p>To keep the CPU busy at all times and minimize response time</p> Signup and view all the answers

    What occurs during a context switch?

    <p>The process state is saved and a new process state is loaded</p> Signup and view all the answers

    Which of the following is NOT a characteristic of context switching?

    <p>It allows the old process to continue execution</p> Signup and view all the answers

    In which scenario does pre-emptive scheduling occur?

    <p>When the process whose time quantum has expired is swapped out</p> Signup and view all the answers

    What is a direct cost of context switching?

    <p>The number of CPU cycles required for load/store operations</p> Signup and view all the answers

    Process Control Blocks (PCBs) hold information regarding which of the following?

    <p>CPU registers and memory-management details</p> Signup and view all the answers

    Which of the following reflects a characteristic of non-preemptive scheduling?

    <p>Processes voluntarily yield control of the CPU when necessary</p> Signup and view all the answers

    Why should the frequency of context switching be limited?

    <p>Frequent context switching incurs unnecessary overhead and slows down system performance</p> Signup and view all the answers

    What does the fork() system call return to the parent process?

    <p>The process ID of the child process</p> Signup and view all the answers

    What is one reason a parent process may terminate its child processes?

    <p>The child has exceeded allocated resources</p> Signup and view all the answers

    Which function allows a parent process to block until a child terminates?

    <p>wait()</p> Signup and view all the answers

    What happens to a child process if its parent terminates without waiting?

    <p>The child process is inherited by init</p> Signup and view all the answers

    What is a characteristic of a zombie process?

    <p>It has completed execution but not yet been reaped by the parent</p> Signup and view all the answers

    What may cause a system to terminate processes?

    <p>Insufficient memory for spawning new processes</p> Signup and view all the answers

    What does the exit() function do in relation to process termination?

    <p>It de-allocates system resources and ends the process</p> Signup and view all the answers

    When does cascading termination occur?

    <p>When the parent process exits and all its children are terminated</p> Signup and view all the answers

    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.

    Quiz Team

    Related Documents

    Unit1_Process (1).ppt

    Description

    Test your understanding of processes in computer systems, covering concepts such as process scheduling and operations. This quiz will challenge your knowledge about what defines a process and its execution dynamics.

    Use Quizgecko on...
    Browser
    Browser