Systems 2 Final Flashcards
23 Questions
100 Views

Systems 2 Final Flashcards

Created by
@JubilantUvarovite

Questions and Answers

What is a process?

An executing program that can launch other processes and be launched by other processes.

What are the main components of a process?

Code, data, stack, heap, and the process control block.

Which of the following are process states? (Select all that apply)

  • New (correct)
  • Suspended
  • Running (correct)
  • Waiting (correct)
  • The kernel operates in low memory.

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

    What is a job queue?

    <p>A set of all processes in the system.</p> Signup and view all the answers

    What is a ready queue?

    <p>A set of all processes residing in memory, ready and waiting to execute.</p> Signup and view all the answers

    What are device queues?

    <p>Sets of processes waiting for an I/O device.</p> Signup and view all the answers

    What is the function of a long-term scheduler?

    <p>To select which process should be brought into the ready queue.</p> Signup and view all the answers

    Describe an I/O bound process.

    <p>A process that spends more time doing I/O than computations, with many short CPU bursts.</p> Signup and view all the answers

    Describe a CPU bound process.

    <p>A process that spends more time doing computations, typically with few very long CPU bursts.</p> Signup and view all the answers

    What is the role of the short-term scheduler?

    <p>To select which process should be executed next and allocate the CPU.</p> Signup and view all the answers

    What is a context switch?

    <p>Switching the CPU from one process to another.</p> Signup and view all the answers

    How is a process created?

    <p>Through system initialization, user requests, or batch job initiation.</p> Signup and view all the answers

    What are the ways a process can terminate?

    <p>Normal exit, error exit, fatal error, or killed by another process.</p> Signup and view all the answers

    What does the fork system call do?

    <p>Creates a new process that is a copy of the calling process.</p> Signup and view all the answers

    What does the execv function do?

    <p>Overwrites the calling process with a new program.</p> Signup and view all the answers

    What is the purpose of the exit system call?

    <p>To terminate a process and return a code to the parent process.</p> Signup and view all the answers

    What does the wait system call do?

    <p>Makes the calling process wait until a child process exits.</p> Signup and view all the answers

    What is the key difference between independent and cooperating processes?

    <p>Independent processes have no shared data.</p> Signup and view all the answers

    Why do we use cooperating processes?

    <p>For information sharing, computation speed-up, modularity, and convenience.</p> Signup and view all the answers

    What is Inter-Process Communication (IPC)?

    <p>Mechanisms for processes to communicate and synchronize their actions.</p> Signup and view all the answers

    How do message-passing systems work?

    <p>They allow processes to communicate without using shared variables.</p> Signup and view all the answers

    What operations does IPC provide?

    <p>Send and receive messages.</p> Signup and view all the answers

    Study Notes

    Process Overview

    • A process is an executing program, distinct and capable of launching or being launched by other processes.
    • Key components within a process include code, data, stack, heap, and a Process Control Block (PCB) containing process state, priority, accounting information, program counter, registers, and open files.

    Process States

    • New: The process is being created.
    • Running: Instructions are currently being executed.
    • Waiting (Blocked): The process awaits an event.
    • Ready: The process is poised for CPU assignment.
    • Terminated: The process has completed execution.

    Memory Allocation

    • Kernel memory operates at high levels, while user memory functions at lower levels.

    Queues in Process Management

    • Job Queue: Contains all processes in the system.
    • Ready Queue: Includes processes in memory, ready for execution.
    • Device Queues: Holds processes waiting for I/O devices.

    Scheduling

    • Long-term Scheduler (Job Scheduler): Decides which processes enter the ready queue, invoked infrequently; controls multiprogramming balance.
    • I/O Bound Process: Prioritizes I/O operations over computations, exhibiting many short CPU bursts.
    • CPU Bound Process: Focuses on computations, characterized by few long CPU bursts.
    • Short-term Scheduler (CPU Scheduler): Determines the next process for execution and allocates CPU resources frequently.

    Context and Process Management

    • Context Switch: Involves switching from one process to another, managed by the scheduler (dispatcher).
    • Process Creation: Initiated through system calls like fork(), user commands, or batch jobs.
    • Process Termination: Can occur normally via main exit, with errors, or through external termination commands.

    System Calls for Process Management

    • fork(): Creates a new process that is an exact copy of the calling process, with distinct memory images post-call; the parent receives the child's process ID while the child receives 0.
    • execv(): Replaces the calling process's memory with a new program specified by programName, using the argument vector argv.
    • exit(): Causes a process to terminate, returning a code to the parent if the parent waits for the child’s termination.
    • wait(): Makes a calling process pause until its created processes exit, retrieving the exit code.

    Process Types

    • Independent Process: Operates without influencing or being influenced by other processes.
    • Cooperating Process: Interacts with other processes, potentially affecting their execution.

    Advantages of Cooperating Processes

    • Facilitate information sharing, enhance computational efficiency, promote modular design, and increase convenience.

    Inter-Process Communication (IPC)

    • IPC mechanisms enable processes to communicate and synchronize actions, including:
      • Shared Memory Systems: Allow processes to share a designated memory region.
      • Message-Passing Systems: Enable processes to exchange messages for collaboration without shared variables.

    Message Passing

    • In message-passing systems, processes communicate distinctly through message exchanges instead of shared data variables.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Test your knowledge on key concepts of processes in systems programming with this comprehensive flashcard quiz. Explore definitions, states, and components related to processes in computing. Perfect for reviewing systems study materials and preparing for exams.

    Use Quizgecko on...
    Browser
    Browser