CS 241 - Operating System: Process Concept

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

What is the primary requirement for process execution?

  • Sequential execution of instructions (correct)
  • Parallel execution of instructions
  • Concurrent execution of multiple programs
  • Simultaneous execution of multiple processes

What is the primary purpose of the stack in a process's memory layout?

  • Storing global variables
  • Storing program code
  • Storing dynamically allocated memory
  • Temporary data storage when invoking functions (correct)

What is the difference between a program and a process?

  • A program is stored on disk, while a process is stored in memory
  • A program is active, while a process is passive
  • A program is executed by the CPU, while a process is executed by the OS
  • A program is passive, while a process is active (correct)

What is the purpose of the data section in a process's memory layout?

<p>Storing global variables (D)</p> Signup and view all the answers

What is the role of the program counter in a process's execution?

<p>It represents the current status of the process's activity (A)</p> Signup and view all the answers

What is a key distinction between the initialized and uninitialized data sections in a process's memory layout?

<p>The initialized data section contains initialized values, while the uninitialized data section contains uninitialized values (B)</p> Signup and view all the answers

What is the maximum number of processes that can be associated with a link?

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

In a non-blocking send operation, what happens after the sender sends the message?

<p>The sender continues executing (B)</p> Signup and view all the answers

What is the characteristic of a zero-capacity buffer?

<p>No messages are queued on a link (D)</p> Signup and view all the answers

What is the term for when both send and receive are blocking?

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

What is the characteristic of an unbounded capacity buffer?

<p>It can queue an infinite number of messages (D)</p> Signup and view all the answers

What is the limitation of ordinary pipes?

<p>They cannot be accessed from outside the process that created it (A)</p> Signup and view all the answers

What information is typically stored in a Process Control Block (PCB)?

<p>List of I/O devices allocated to the process, scheduling and memory-management information, and list of open files. (C)</p> Signup and view all the answers

What is the purpose of the field 'long state' in the task struct?

<p>To represent the state of a process. (B)</p> Signup and view all the answers

What is the data structure used to represent all active processes in the Linux kernel?

<p>A doubly linked list of task struct. (C)</p> Signup and view all the answers

What is the relationship between a process and its parent process?

<p>A process is a child of its parent process. (B)</p> Signup and view all the answers

What is the purpose of the 'pid' field in the task struct?

<p>To store the process ID of a process. (A)</p> Signup and view all the answers

What is the term for a process that is created by another process?

<p>Child process. (B)</p> Signup and view all the answers

What is the primary goal of the process scheduler?

<p>To maximize CPU usage and quickly switch processes onto the CPU core (A)</p> Signup and view all the answers

What type of data structure is used to store the ready queue?

<p>Linked list (D)</p> Signup and view all the answers

What happens to a process when it issues an I/O request?

<p>It is placed in an I/O wait queue (C)</p> Signup and view all the answers

What triggers a process to be removed from the CPU core and placed back in the ready queue?

<p>An interrupt or the expiration of its time slice (D)</p> Signup and view all the answers

What is the status of a process in the wait queue?

<p>Waiting for an event to occur (D)</p> Signup and view all the answers

Where is a new process initially placed in the system?

<p>Ready queue (D)</p> Signup and view all the answers

What is the primary difference between named pipes and ordinary pipes?

<p>Named pipes are bidirectional, ordinary pipes are unidirectional (C)</p> Signup and view all the answers

What is the purpose of a socket in a networked system?

<p>To act as an endpoint for communication between two systems (D)</p> Signup and view all the answers

What is the primary function of a stub in a remote procedure call?

<p>To locate the server and marshall the parameters for the procedure call (A)</p> Signup and view all the answers

What is the significance of the IP address 127.0.0.1 in socket communication?

<p>It is used to refer to the system on which the process is running (C)</p> Signup and view all the answers

What is the primary difference between a socket and a pipe?

<p>A socket is used for communication between two systems, a pipe is used for communication between two processes on the same system (D)</p> Signup and view all the answers

What is the purpose of port numbers in socket communication?

<p>To differentiate between multiple services on a host (D)</p> Signup and view all the answers

Flashcards are hidden until you start studying

Study Notes

Process Execution Requirements

  • A process requires a unique identifier (PID) and allocated memory to execute.
  • Memory layout includes various sections: code, stack, heap, and data.

Purpose of Stack in Memory Layout

  • The stack is used for function call management, including local variables and return addresses.
  • Supports Last In, First Out (LIFO) operation, allowing orderly function execution and exits.

Difference Between Program and Process

  • A program is a static set of instructions stored on disk; a process is an active execution of a program.
  • Multiple processes can run the same program concurrently.

Purpose of the Data Section

  • The data section stores global and static variables that are initialized prior to execution.
  • Divided into initialized and uninitialized data segments for memory management.

Role of the Program Counter

  • The program counter keeps track of the next instruction to be executed in a process.
  • It is essential for the flow of execution and maintaining order in instruction processing.

Initialized vs. Uninitialized Data Sections

  • Initialized data section contains variables with defined initial values.
  • Uninitialized data section holds variables set to zero or undefined until assigned.
  • A link can associate a maximum of 256 processes, depending on system limitations.

Non-Blocking Send Operations

  • After sending a message, the sender does not wait for the receiver to acknowledge receipt.
  • This allows the sender to continue executing other tasks immediately.

Characteristic of a Zero-Capacity Buffer

  • A zero-capacity buffer does not store any messages; it requires the sender and receiver to be synchronized.

Blocking Send and Receive

  • Blocking send occurs when the sender waits for the receiver's acknowledgment.
  • Blocking receive waits for a message to be sent before proceeding with execution.

Characteristic of an Unbounded Capacity Buffer

  • An unbounded buffer can grow in size infinitely, accommodating as many messages as needed.

Limitation of Ordinary Pipes

  • Ordinary pipes provide unidirectional communication and require a direct parent-child process relationship.

Process Control Block (PCB) Information

  • A PCB stores process state, PID, program counter, CPU registers, memory management information, and I/O status.

Purpose of 'long state' in Task Struct

  • The 'long state' field indicates the current status of a process (e.g., running, waiting, or stopped).

Data Structure for Active Processes in Linux

  • A task struct represents all active processes, linking their PCBs for process management.

Process-Parent Relationship

  • Each process has a parent process that creates it, establishing a hierarchical relationship in process management.

Purpose of 'pid' Field in Task Struct

  • The 'pid' field uniquely identifies each process in the system, crucial for process control and management.

Term for Child Process

  • A process created by another process is referred to as a child process.

Primary Goal of Process Scheduler

  • The process scheduler aims to optimize CPU utilization, fairness, and response time among processes.

Data Structure for Ready Queue

  • A queue, often a linked list or array, organizes processes ready for execution by the CPU.

I/O Request Process Behavior

  • When a process issues an I/O request, it moves from a running state to a blocked state until the operation completes.

Trigger for Process to Leave CPU

  • A process is removed from the CPU when it is preempted by a higher-priority process or issues an I/O request.

Process Status in Wait Queue

  • A process in the wait queue is in a blocked state, waiting for a specific event or resource to proceed.

Initial Placement of New Processes

  • New processes are initially placed in a ready queue, awaiting CPU time for execution.

Named Pipes vs. Ordinary Pipes

  • Named pipes support bidirectional communication and can be accessed by unrelated processes, unlike ordinary pipes.

Purpose of Sockets in Networked Systems

  • Sockets facilitate communication between processes over networks, enabling data exchange between different systems.

Function of Stub in Remote Procedure Call

  • A stub acts as a proxy for remote procedure calls, handling communication between the client and server.

Significance of IP Address 127.0.0.1

  • The IP address 127.0.0.1, known as localhost, allows a device to communicate with itself for testing.

Difference Between Sockets and Pipes

  • Sockets provide network communication capabilities, while pipes are used for inter-process communication within the same system.

Purpose of Port Numbers in Socket Communication

  • Port numbers identify specific processes or services on a device, enabling targeted communication over a network.

Studying That Suits You

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

Quiz Team

More Like This

Use Quizgecko on...
Browser
Browser