Podcast
Questions and Answers
What is a process?
What is a process?
A program in execution.
Which of the following are parts of a process?
Which of the following are parts of a process?
- Data section (correct)
- Heap (correct)
- Program code (correct)
- Current activity (correct)
- File metadata
A program is a _____ entity stored on disk.
A program is a _____ entity stored on disk.
passive
A process can have multiple program counters.
A process can have multiple program counters.
What does the state 'Running' mean for a process?
What does the state 'Running' mean for a process?
What does the 'Waiting' state indicate?
What does the 'Waiting' state indicate?
What is contained within a Process Control Block (PCB)?
What is contained within a Process Control Block (PCB)?
What is the goal of process scheduling?
What is the goal of process scheduling?
A context switch occurs when the CPU switches from one process to another.
A context switch occurs when the CPU switches from one process to another.
Flashcards are hidden until you start studying
Study Notes
Process Concept
- Operating systems execute various programs as processes, which are programs in execution.
- A process must progress sequentially; no parallel execution of instructions occurs within a single process.
- Key components of a process include:
- Program Code (Text Section)
- Current Activity: Includes program counter and processor registers.
- Stack: Stores temporary data such as function parameters, return addresses, and local variables.
- Data Section: Contains global variables.
- Heap: Memory allocated during runtime dynamically.
Process Activation
- A program remains passive when stored on disk (executable file); it becomes an active process when loaded into memory.
- Program execution can start from GUI mouse clicks or command-line entries.
- One program can have multiple processes, allowing for concurrent users accessing the same application.
Process State
- Processes shift between various states as they execute:
- New: Process is being created.
- Running: Instructions are actively executed.
- Waiting: Process waits for an event to occur.
- Ready: Process is prepared to be assigned to a processor.
- Terminated: Process has completed execution.
Process Control Block (PCB)
- PCB contains vital information about each process, also known as the task control block.
- Key elements within PCB include:
- Process State: Indicates current status (e.g., running, waiting).
- Program Counter: Points to the next instruction to execute.
- CPU Registers: Holds values of all process-centric registers.
- CPU Scheduling Information: Contains priorities and scheduling queue pointers.
- Memory-Management Information: Details memory allocated to the process.
- Accounting Information: Tracks CPU time used, elapsed clock time since process start, and time limits.
- I/O Status Information: Lists I/O devices allocated to the process and open files.
Threads in Processes
- Initially, processes have a single thread of execution.
- Multiple threads of control can be created, requiring storage for additional program counters in the PCB.
Process Scheduling
- The process scheduler is responsible for selecting the next process for CPU execution.
- Goals include maximizing CPU usage and maintaining scheduling queues:
- Ready Queue: Includes processes in main memory that are ready and waiting for execution.
- Wait Queues: Includes processes waiting for I/O or other events.
- Processes transition between various queues as they execute.
Queueing Diagram Representation
- Commonly visualized through queueing diagrams illustrating the flow of jobs between the ready queue, CPU, and I/O queues.
- Illustrates how processes interact with CPU and handle I/O requests.
Context Switching
- Occurs when the CPU transitions from executing one process to another.
- Involves saving the current process state into its PCB and loading the state of the next process.
- Context switches can occur due to interrupts or system calls.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.