Processes in Operating System – Definition, Structure & Components | DIT Notes

Processes in Operating System – Definition & Components DIT Notes
DIT Operating System 3.1 - Processes
DIT • SEMESTER 1 • OPERATING SYSTEM • ARTICLE 3.1

Processes

A clear, exam-oriented guide to the definition of a process, the difference between a program and a process, and the basic components contained in a process.

Unit 3 Processes Article 3.1 Core Concept Exam Preparation 4 Short 2 Long 10 MCQs

Quick Access

Jump directly to any part of Article 3.1.

3.1.1 Definition of Process

Understanding the central concept of a process in an Operating System.

A process is a program in execution. It includes the program instructions as well as the current activities and resources required for its execution.

Definition: A process is a program in execution. It is not only the program instructions; it also includes the current activities and resources required while the program is executing.

When a program is stored on a disk, it is simply a set of instructions. When that program is loaded into memory and starts executing, it becomes a process. The Operating System manages processes and controls their execution so that multiple programs can run efficiently.

FIGURE 1 • CONCEPT FLOW
From Program to Process
STORED ON DISK

Program

A passive set of instructions stored on a storage device.

LOADED + EXECUTING

Process

An active instance of the program, together with its current activities and required resources.

Caption: A stored program becomes a process when it is loaded into memory and starts executing.
Exam Tip: Remember the shortest exam definition: A process is a program in execution.

3.1.2 Program vs. Process

The key distinction between a passive program and an active process.

Program Process
A passive set of instructions. An active instance of a program during execution.
Stored on a storage device. Loaded into memory and executing.
By itself, it is not currently executing. Includes current activities and resources required for execution.
Important: The source material specifically describes the program as passive and the process as active. This difference is a common exam point.

3.1.3 Example

A simple real-world computer example of program versus process.

Consider calculator.exe on a computer. When calculator.exe is stored on the computer, it is a program. When the user opens Calculator and it starts running, it becomes a process.

FIGURE 2 • EXAMPLE
calculator.exe: Program to Process
Stored File calculator.exe exists as a set of instructions on storage.
Passive The program is not currently executing.
▣
Calculator Process Program loaded into memory and executing
  • Program instructions
  • Current activities
  • Required resources
User Action The user opens Calculator.
Execution The stored program starts running.
Caption: Opening Calculator changes the stored program into an executing process.

3.1.4 What a Process Contains

The basic structure and components associated with a process.

A process generally contains the following components:

Program CodeInstructions to be executed.
DataInformation required by the program.
CPU StateCurrent CPU registers and program counter values.
StackTemporary data, function calls and local variables.
ResourcesResources assigned to the process, such as files and memory.

1. Program Code

Program Code contains the instructions that are to be executed.

2. Data

Data contains the information required by the program.

3. CPU State

CPU State represents the current values of CPU registers and the program counter.

4. Stack

The Stack stores temporary data such as function calls and local variables.

5. Resources

Resources are resources assigned to the process, such as files and memory.

FIGURE 3 • BASIC PROCESS STRUCTURE
A Process Contains Instructions, Data, CPU State, Stack and Resources
Program CodeInstructions to be executed
DataInformation required by the program
P
PROCESS Program in execution
  • Current activities
  • Execution information
  • Required resources
CPU StateRegisters and program counter values
Stack + ResourcesTemporary data, files, memory and other assigned resources
Caption: The basic process structure includes program code, data, CPU state, stack and assigned resources.
Exam Focus:
  • Define a process as a program in execution.
  • Know the difference between a passive program and an active process.
  • Memorize the five basic components: Program Code, Data, CPU State, Stack and Resources.
  • Remember the calculator.exe example.

Quick Revision

Fast review of the complete Article 3.1.

  • A process is a program in execution.
  • A program is a passive set of instructions stored on a storage device.
  • A process is an active instance of a program during execution.
  • When a stored program is loaded into memory and starts executing, it becomes a process.
  • The calculator.exe example shows the difference clearly: stored calculator.exe is a program; running Calculator is a process.
  • A process generally contains Program Code, Data, CPU State, Stack and Resources.
Exam Focus:
  • Definition of process
  • Program versus process
  • Basic process components
  • Meaning of CPU State and Stack
  • Examples of resources assigned to a process

4 Short Questions & Answers

Click a question to reveal its answer.

Q1. What is a process?

A process is a program in execution. It includes the program instructions as well as the current activities and resources required for its execution.

Q2. What is the difference between a program and a process?

A program is a passive set of instructions stored on a storage device, while a process is an active instance of that program during execution.

Q3. Name the main components contained in a process.

The main components are Program Code, Data, CPU State, Stack and Resources.

Q4. Give the calculator.exe example of a program and a process.

When calculator.exe is stored on a computer, it is a program. When the user opens Calculator and it starts running, it becomes a process.

2 Long Questions & Answers

Structured answers suitable for approximately 5-mark preparation.

Q1. Define a process and explain the difference between a program and a process.

A process is a program in execution. It includes the program instructions as well as the current activities and resources required for its execution.

A program is a passive set of instructions stored on a storage device. A process is an active instance of that program during execution.

  • A program is stored and passive.
  • A process is active and executing.
  • A process is loaded into memory and has current activities and required resources.

For example, calculator.exe stored on a computer is a program. When the user opens Calculator and it starts running, it becomes a process.

Q2. Explain the basic structure and components of a process.

A process generally contains several parts that represent the instructions, information, execution state and resources needed during execution.

  • Program Code: Contains the instructions to be executed.
  • Data: Contains information required by the program.
  • CPU State: Contains current values of CPU registers and the program counter.
  • Stack: Stores temporary data such as function calls and local variables.
  • Resources: Includes resources assigned to the process, such as files and memory.

Together, these components form the basic information and resources associated with a program while it is executing as a process.

10 Important MCQs

Open an MCQ to view its options, then use Show Answer to check your response.

1. What is a process?
A) A program stored only on a storage device
B) A program in execution
C) A hardware device
D) A type of storage medium
Show Answer
Correct Answer: B) A program in execution
2. A program stored on a storage device is best described as a ______.
A) Passive set of instructions
B) CPU state
C) Running process
D) Stack
Show Answer
Correct Answer: A) Passive set of instructions
3. When a program is loaded into memory and starts executing, it becomes a ______.
A) File
B) Resource
C) Process
D) Storage device
Show Answer
Correct Answer: C) Process
4. Which component contains the instructions to be executed?
A) Program Code
B) Stack
C) Resources
D) CPU State
Show Answer
Correct Answer: A) Program Code
5. Which process component contains information required by the program?
A) Stack
B) Data
C) Program Code
D) Resources
Show Answer
Correct Answer: B) Data
6. CPU State includes the current values of CPU registers and the ______.
A) File name
B) Storage device
C) Program counter
D) User interface
Show Answer
Correct Answer: C) Program counter
7. Which component stores function calls, local variables and temporary data?
A) Data
B) Stack
C) Program Code
D) Resources
Show Answer
Correct Answer: B) Stack
8. Which of the following is an example of a resource assigned to a process?
A) Files and memory
B) Only program instructions
C) Only local variables
D) Only the program counter
Show Answer
Correct Answer: A) Files and memory
9. Which statement correctly describes a process?
A) It is always a passive set of instructions.
B) It is an active instance of a program during execution.
C) It is a storage device.
D) It contains only program code.
Show Answer
Correct Answer: B) It is an active instance of a program during execution.
10. In the calculator.exe example, when the user opens Calculator and it starts running, calculator.exe becomes a ______.
A) Program only
B) Process
C) Storage device
D) Data section
Show Answer
Correct Answer: B) Process

Final Exam Reminder

Revise the core points before attempting the test.

No comments