100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Process Scheduling of Operating systems $4.69   Add to cart

Class notes

Process Scheduling of Operating systems

 6 views  0 purchase
  • Course
  • Institution

In these notes, Covered all the topics of operating systems briefly. COs - Analyze the structure of OS and basic architectural components involved in OS design. Compare and contrast various CPU scheduling algorithms. Evaluate the requirements for the process synchronization and co-ordinatio...

[Show more]

Preview 3 out of 29  pages

  • December 30, 2022
  • 29
  • 2021/2022
  • Class notes
  • Ymk sir
  • All classes
avatar-seller
2 – Processes & Threads

(1) What is Process? Give the difference between Process and Program.
Process:
• Process is a program under execution.
• It is an instance of an executing program, including the current values of the pro-
gram counter, registers & variables.
• Process is an abstraction of a running program.


Process Program
A process is program in execution. A program is set of instructions.
A process is an active/ dynamic entity. A program is a passive/ static entity.
A process has a limited life span. It is A program has a longer life span. It is
created when execution starts and stored on disk forever.
terminated as execution is finished.
A process contains various resources A program is stored on disk in some file.
like memory address, disk, printer It does not contain any other resource.
etc… as per requirements.
A process contains memory address A program requires memory space on
which is called address space. disk to store all instructions.


(2) What is multiprogramming?
• A process is just an executing program, including the current values of the program
counter, registers, and variables.
• Conceptually, each process has its own virtual CPU.
• In reality, the real CPU switches back and forth from process to process, but to under-
stand the system, it is much easier to think about a collection of processes running in
(pseudo) parallel, than to try to keep track of how the CPU switches from program to
program.
• This rapid switching back and forth is called multiprogramming and the number of pro-
cesses loaded simultaneously in memory is called degree of multiprogramming.


(3) What is context switching?
• Switching the CPU to another process requires saving the state of the old process and

1

, 2 – Processes & Threads
loading the saved state for the new process.
• This task is known as a context switch.
• The context of a process is represented in the PCB of a process; it includes the value of
the CPU registers, the process state and memory-management information.
• When a context switch occurs, the kernel saves the context of the old process in its PCB
and loads the saved context of the new process scheduled to run.
• Context-switch time is pure overhead, because the system does no useful work while
switching.
• Its speed varies from machine to machine, depending on the memory speed, the num-
ber of registers that must be copied, and the existence of special instructions.




Figure 2-1. Context Switching


(4) Explain Process Model in brief.
• In this model, all the runnable software on the computer, sometimes including the op-
erating system, is organized into a number of sequential processes.
• A process is just an executing program, including the current values of the program
counter, registers, and variables.
• Conceptually, each process has its own virtual CPU.
• In reality, of course, the real CPU switches back and forth from process to process, but
to understand the system, much easier to think about a collection of processes running


2

, 2 – Processes & Threads
in (pseudo) parallel, than to try to keep track of how the CPU switches from program to
program.
• This rapid switching back and forth is called multiprogramming.
• In Fig. 2-2 (a) we see a computer multiprogramming four programs in memory.
• In Fig. 2-2 (b) we see four processes, each with its own flow of control (i.e., its own logi-
cal program counter), and each one running independently of the other ones.
• There is only one physical program counter, so when each process runs, its logical pro-
gram counter is loaded into the real program counter.
• When it is finished for the time being, the physical program counter is saved in the pro-
cess’ logical program counter in memory.
• In Fig. 2-2 (c) we see that over a long period of time interval, all the processes have
made progress, but at any given instant only one process is actually running.
• With the CPU switching back and forth among the processes, the rate at which a pro-
cess performs its computation will not be uniform and probably not even reproducible
if the same processes are run again.
• Thus, processes must not be programmed with built-in assumptions about timing.




Figure 2-2. (a) Multiprogramming of four programs. (b) Conceptual model of four inde-
pendent, sequential processes. (c) Only one program is active at once.


Process Creation
• There are four principal events that cause processes to be created:
1. System initialization.
2. Execution of a process creation system call by a running process.
3. A user request to create a new process.
4. Initiation of a batch job.


3

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller vaibhav51ppsv2020. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $4.69. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79271 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$4.69
  • (0)
  Add to cart