Midterm Lessons
Midterm Lessons
Process
A Process is:
1. Process creation
2. Termination of the process
3. Controlling the progress of the process
4. Process Scheduling
5. Dispatching
6. Interrupt handling/Exceptional handling
7. Switching between the processes
8. Process synchronization
9. Inter process communication support
10. Management of Process Control Blocks
Process States
1. Convoy Effect
- If a long process arrives first, it may cause
shorter processes to wait, leading to poor
overall system performance.
2. Waiting Time
- FCFS scheduling may result in high waiting
times for processes that arrive later.
3. No Prioritization
- It doesn't consider the priority or
characteristics of processes, potentially
Turn Around Time = Completion time – Arrival Time
impacting critical tasks.
Waiting Time = Turn Around Time – Burst Time
Real-Life Examples of FCFS Scheduling
Average Turn Around Time
1. Restaurant Queues
- Customers are served in the order they Average Waiting Time
arrive, ensuring a fair allocation of
resources.
2. Ticket Counters Conclusion and Summary of FCFS Scheduling Algorithm
- First customers in line are served first,
reducing conflicts and promoting FCFS offers simplicity, fairness, and minimal overhead.
orderliness. However, it can suffer from the convoy effect, high waiting
3. Retail Checkout times, and the lack of prioritization. Understanding the
- Follows FCFS to ensure fairness in serving algorithm's advantages, limitations, and real-life examples is
customers in the order they arrive with crucial when considering its implementation.
their purchases.
Shortest Job First program then sorts the processes based on burst time and
executes them in order.
What is SJF?
Coding
SJF is a non-preemptive or preemptive scheduling algorithm
that processes the shortest job first, then the next shortest, The implementation of SJF in code depends on the
and so on. It minimizes waiting time and provides faster programming language used. Most languages provide
response times. functions to sort arrays that can be used to implement SJF.
Priority Scheduling
Conclusion:
Summary
Takeaways
Processes QA: 9. The degree of multi-programming is:
a) No. of processes executed per unit
1. Process is
time
a) Program in high level language kept
b) No. of processes in the ready queue
on desk
c) No. of processes in the I/O queue
b) Contents of main memory
d) No. of processes in the memory
c) A program in execution
10. The child process completes execution, but
d) Job in secondary memory
the parent keeps executing, then the child
2. Which of the following is not the state of a
process is known as:
process?
a) Orphan
a) New
b) Zombie
b) Old
c) Body
c) Waiting
d) Dead
d) Running
11. Context switch is involved in
3. What is the ready state of a process?
a) Switching computer on
a) When process is scheduled to run
b) Switching CPU from one process to
after some execution
another
b) When process is unable to run until
c) Switching a process on
some task has been completed
d) None of these
c) When process is using the CPU
12. Scheduling a process from Ready Queue to
d) None of the mentioned
CPU is done by
4. What is interprocess communication?
a) Short term scheduler
a) CPU registers
b) Middle term scheduler
b) Program counter
c) Long-term scheduler
c) Process stack
d) dispatcher
d) Pipe
5. The address of the next instruction to be
executed by the current process is provided by
the
a) CPU registers
b) Program counter
c) Process stack
d) pipe
6. In unix, which system call creates the new
process?
a) Fork
b) Create
c) New
d) None of the mentioned
7. A process Control Block (PCB) does not
contain which of the following:
a) Code
b) Stack
c) Program Counter
d) Bootstrap program
8. The process control block is:
a) Process type variable
b) Data structure
c) A secondary storage section
d) A block in memory