lecture 2
Download
Skip this Video
Download Presentation
Lecture 2

Loading in 2 Seconds...

play fullscreen
1 / 32

Lecture 2 - PowerPoint PPT Presentation


  • 88 Views
  • Uploaded on

Lecture 2. Process Concepts, Performance Measures and Evaluation Techniques. Lecture Highlights. What is a process Process Control Block Process states and process life cycle Performance Measures Evaluation Techniques. What is a process.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Lecture 2' - trudy


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
lecture 2

Lecture 2

Process Concepts, Performance Measures and Evaluation Techniques

lecture highlights
Lecture Highlights
  • What is a process
  • Process Control Block
  • Process states and process life cycle
  • Performance Measures
  • Evaluation Techniques
what is a process
What is a process
  • A process is a pre-written set of ordered instructions which when executed causes the computer to behave in a manner determined by the code
  • A process is a program/part of machine code in execution
  • New process are spawned either by a user or by other processes.
process and the operating system
Process and the operating system

When a new process is created, the operating system typically does the following:

  • Assigns the process a unique process id (PID)
  • Allocates a chunk of memory from the available heap for the process
  • Initializes a new PCB (Process Control Block)
  • Adds the process to appropriate scheduling queues
  • Other maintenance tasks
process control block pcb
Process Control Block (PCB)

A PCB is a data structure which stores certain information about each process. A typical PCB looks as follows:

  • Process ID (PID)
  • Time of Arrival (TOA)
  • Execution Time
  • Priority/ Process Type
  • Size (Location in memory)
  • Program Counter
  • Registers/Threads
  • Needed Resources
pcb components process id
PCB components Process ID

The system assigns each process a unique identifier which is used by other processes for scheduling, communication and any other purpose.

pcb components time of arrival
PCB components Time of Arrival

The system keeps track of the time a process enters the process queue for scheduling purposes.

pcb components execution time
PCB components Execution Time

This parameter is used by scheduling algorithms which order processes by the amount of time they need to complete execution. Mathematical formulae are used to calculate the estimated execution time of a process.

pcb components priority
PCB components Priority

Some processes, such as system processes, have a higher priority than others and the operating system uses this priority during scheduling and memory management.

pcb components size
PCB components Size

It is the size of the process in bytes. This parameter indicates the memory location of a process also.

pcb components program counter
PCB components Program Counter

The program counter value stores the address of the next instruction to be executed.

pcb components registers threads
PCB components Registers/Threads

This PCB parameter saves the state of different registers used by that particular process.

pcb components needed resources
PCB components Needed Resources

This PCB parameter indicates the quantities of system resources needed by that particular process.

process states
Process States

The state of a process is defined in part by its current activity. As it executes, it changes state. Each process may be in one of the following states:

  • New: The process is being created
  • Running: Instructions are being executed
  • Waiting: The process is waiting for some event to occur
  • Ready: The process is waiting to be assigned to a processor
  • Terminated: The process has finished execution
process life cycle

terminated

new

admitted

interrupted

exit

ready

running

scheduler dispatch

I/O or event completion

I/O or event wait

waiting

Process Life Cycle
uploading downloading pcbs

CONTEXT SWITCH

CONTEXT SWITCH

Uploading/Downloading PCBs

Process P0 operating system Process P1

Interrupt or system call

executing

.

.

.

.

.

.

.

.

.

.

.

.

.

Save state into PCB0

.

.

.

.

.

.

.

idle

Reload state from PCB1

executing

idle

Interrupt or system call

Save state into PCB1

.

.

.

.

.

.

.

idle

Reload state from PCB0

executing

performance measures
Performance Measures

It is important to quantify performance so that it can be measured. Commonly used performance measures:

  • CPU Utilization
  • Turnaround time
  • Waiting time
  • Throughput
  • Response time

Before we discuss the individual performance measures, we need to understand the related concepts of context switching and starvation.

slide18

Performance MeasuresRelated Concept - Context Switch

  • Switching the CPU to another process requires saving the state of the old process and loading the state of the new process. This task is known as a context switch. (it is labeled in the diagram uploading/downloading PCBs)
  • Increased context switching affects performance adversely because the CPU spends more time switching between tasks than it does with the tasks itself.
performance measures related concept starvation
Performance MeasuresRelated Concept - Starvation
  • This is the situation where a process waits endlessly for CPU attention.
  • As a result of starvation, the starved process may never complete its designated task.
performance measures cpu utilization
Performance MeasuresCPU Utilization
  • It is the ratio of time that the CPU is doing actual processing to the total CPU time observed.
  • This is a true measure of performance since it measures efficiency of the system. An idle CPU has 0% CPU utilization since it offers null performance per unit cost. The higher the CPU utilization, the better the efficiency of the system
performance measures turnaround time
Performance MeasuresTurnaround Time
  • The time between a process’s arrival into the system and its completion.
  • Two related parameters that can be studied include average turnaround time and maximum turnaround time.
  • The turnaround time includes the context switching times and execution times.
  • The turnaround time is inversely related to the system performance i.e. lower turnaround times imply better system performance.
performance measures waiting time
Performance Measures Waiting Time
  • Waiting time is the sum of the periods spent waiting in the ready queue.
  • Mathematically, it is the difference between the turnaround time and execution time.
  • It inversely affects system performance.
  • It has two related forms: average waiting time and maximum waiting time.
  • As a point of interest, the CPU scheduling algorithm does not affect the execution time of a process but surely determines the waiting time.
performance measures throughput
Performance MeasuresThroughput
  • The average number of processes completed per unit time.
  • Higher throughput is generally considered as indicative of increased performance.
  • However, it should not be the sole performance criterion taken into account because throughput does not take into account loss of performance caused by starvation.
performance measures response time
Performance MeasuresResponse Time
  • The time difference between submission of the process and the first I/O operation is termed response time.
  • It affects performance inversely.
  • However, it is not considered to be a reasonable measure and is rarely used.
evaluation techniques
Evaluation Techniques

When developing an operating system or the modules thereof, evaluation of its performance is needed before it is installed for real usage. Evaluation provides useful clues to which algorithms would best serve the cases of application.

evaluation techniques three common techniques
Evaluation TechniquesThree Common Techniques

All evaluation techniques can be classified into the following three types:

  • Analytic method
  • Implementation in real time systems
  • Simulation Method
evaluation techniques analytic method
Evaluation TechniquesAnalytic Method

In the analytic method, a mathematical formula is developed to represent a computing system. This method provides clear and intuitive evaluation of system performance, and is most useful to a specific algorithm. However, it is too simple to examine a complex and near-real system.

evaluation techniques implementation in real time systems
Evaluation TechniquesImplementation in real-time systems
  • Another way is to implement an operating system in a real machine. This method produces a complete and accurate evaluation.
  • A disadvantage with it is its dramatic cost.
  • Also evaluation is dependent on the environment of machine in which evaluation is carried out.
evaluation techniques simulation method
Evaluation TechniquesSimulation Method
  • Simulation is a method that uses programming technique to develop a model of a real system.
  • Implementation of the model with prescribed jobs shows how the system works.
  • Furthermore, the model contains a number of algorithms, variables, and parameters.
  • Changing the above factors in simulation, one is able to know how the system performance would be affected and, therefore, to predict possible changes in performance of the real system.
  • This method has a balanced complexity and cost. It was viewed as the most potentially powerful and flexible of the evaluation techniques
simulation method the evaluation technique used in this course
Simulation Method The evaluation technique used in this course

The simulation method entails development of a model of a real system which contains a number of algorithms, variables and parameters. Changing these factors in simulation enables one to know its affect on system performance. This method, thus, is best suited for our purpose of studying the operating systems design.

lecture summary
Lecture Summary
  • What is a process
  • Process Control Block
  • Process states and process life cycle
  • Performance Measures
  • Evaluation Techniques
  • Justification of simulation method as the chosen technique for this course
preview of next lecture
Preview of next lecture

The following topics shall be covered in the next lecture:

  • Introduction to CPU scheduling
    • What is CPU scheduling
    • Related Concepts of Starvation, Context Switching and Preemption
  • Scheduling Algorithms
  • Parameters Involved
  • Parameter-Performance Relationships
  • Some Sample Results
ad