Operating system concepts

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

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.

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.

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.

<p>program counter</p> Signup and view all the answers

The PCB stores details of all related to a process, including its current state, unique identification number, and memory management ______.

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

When a process transitions to the ______ state, it signifies that the process has completed its execution and is no longer active in the system.

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

Compared to a batch system, a ______ is designed to handle multiple interactive user programs or tasks, providing timely responses to user inputs.

<p>time-shared system</p> Signup and view all the answers

In contrast to initialized ______, uninitialized ______ such as int x; in a C program, reside in a specific section of memory within a running process.

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

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.

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

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.

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

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.

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

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.

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

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.

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

The time spent on the process of switching between different processes is known as time ______, and it doesn't contribute to useful work.

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

In the process state diagram, the transition from the 'Ready' state to the 'Running' state is triggered by the ______ dispatch.

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

A process that spends more time waiting for I/O and has short CPU bursts is known as an ______ bound process.

<p>I/O</p> Signup and view all the answers

A process that spends more time doing computations and has few but long CPU bursts is considered a ______ bound process.

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

When a process is in the 'Running' state and an interrupt occurs, it transitions back to the ______ state.

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

[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.

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

Processes are identified and managed by the operating system using a unique ______ (Process Identifier).

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

In process creation, parent and child processes can be configured such that they do not share any resources, resulting in ______ resources for both.

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

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.

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

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.

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

A child process that terminates but whose parent has not yet called wait on it becomes a ______ process.

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

Cooperating processes require a mechanism for __________, which enables them to exchange data and synchronize actions.

<p>Interprocess communication</p> Signup and view all the answers

In the __________ model of interprocess communication, cooperating processes communicate by reading and writing to a shared region of memory.

<p>shared memory</p> Signup and view all the answers

__________ is an interprocess communication model that uses system calls to exchange data, and is often used for communication across multiple systems.

<p>Message passing</p> Signup and view all the answers

__________ communication requires processes to explicitly name the sender or receiver, creating a direct link between the communicating processes.

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

__________ communication involves the use of mailboxes or ports through which processes send and receive messages, allowing for more flexible communication patterns.

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

A __________ send operation blocks the sender until the message is received, ensuring that the data has been successfully transmitted before the sender continues.

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

In a rendezvous, both the send and receive operations are __________, meaning both the sender and receiver are blocked until the message is successfully transmitted.

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

A __________ send operation allows the sender to continue processing immediately after sending the message, without waiting for confirmation of receipt.

<p>non-blocking</p> Signup and view all the answers

Flashcards

Uniprogramming

One process loaded into RAM.

Multiprogramming

Multiple processes loaded into RAM.

Multitasking

Multiple processes executing in RAM from different users, seemingly simultaneously.

Multiprocessing

Multiple CPUs or microprocessors execute multiple processes.

Signup and view all the flashcards

Multithreading

One process contains multiple threads of execution.

Signup and view all the flashcards

Process

An active program in execution, executing sequentially.

Signup and view all the flashcards

PCB (Process Control Block)

Stores information about a process, such as state and ID.

Signup and view all the flashcards

Process State

Indicates the current status of a process (e.g., running, waiting).

Signup and view all the flashcards

Process Scheduling Queues

Containers for processes waiting for resources (CPU, I/O).

Signup and view all the flashcards

Types of Process Scheduling Queues

Job queue (all processes), ready queue (processes in memory, ready to run), and device queue (processes waiting for I/O).

Signup and view all the flashcards

Types of Process Schedulers

Short-term (CPU scheduler), long-term (job scheduler), and medium-term scheduler.

Signup and view all the flashcards

Short-Term Scheduler

Selects which process should be executed next and allocates the CPU.

Signup and view all the flashcards

Long-Term Scheduler

Selects which processes are brought into the ready queue.

Signup and view all the flashcards

Medium-Term Scheduler

Reduces multiprogramming by swapping processes out of memory and onto disk.

Signup and view all the flashcards

I/O-Bound Process

Process spends more time waiting for I/O with short CPU bursts (uses CPU briefly).

Signup and view all the flashcards

CPU-Bound Process

Process spends more time doing computations with a few, long CPU bursts (uses CPU for longer periods).

Signup and view all the flashcards

Time Overhead (Context Switching)

The time the OS spends switching between processes, not doing useful work.

Signup and view all the flashcards

New State

A process state indicating the process is newly created but not yet ready to run.

Signup and view all the flashcards

Ready State

A process state where the process is ready to be executed but is waiting for the CPU.

Signup and view all the flashcards

Running State

A process state where the process is currently being executed by the CPU.

Signup and view all the flashcards

Terminated State

A process state indicating the process has completed its execution.

Signup and view all the flashcards

Waiting State

A process transitions to this state when it needs to wait for an I/O operation or event.

Signup and view all the flashcards

PID (Process Identifier)

A unique identifier used to manage and track each process.

Signup and view all the flashcards

Zombie Process

A process that has terminated, but its entry still exists in the process table.

Signup and view all the flashcards

Cooperating Process

A process that can affect or be affected by other processes.

Signup and view all the flashcards

Interprocess Communication (IPC)

Mechanisms that allow cooperating processes to communicate and synchronize their actions.

Signup and view all the flashcards

Shared Memory

IPC method where processes communicate by reading and writing to a shared memory region.

Signup and view all the flashcards

Message Passing

IPC method where processes communicate by exchanging messages.

Signup and view all the flashcards

Direct Communication

Each process must explicitly name the sender or receiver for communication.

Signup and view all the flashcards

Indirect Communication

Processes communicate through a shared mailbox (or port) with a unique ID.

Signup and view all the flashcards

Blocking (Synchronous) Communication

The sender is blocked until the message is received, or the receiver is blocked until a message is available.

Signup and view all the flashcards

Non-blocking (Asynchronous) Communication

The sender sends the message and continues, or the receiver receives a valid message or a NULL message (if none is available).

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.

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.

Quiz Team

Related Documents

CH3 Processes PDF

More Like This

Use Quizgecko on...
Browser
Browser