You are on page 1of 5

Batch system, task with similar requirements

Process, may have text section, program counter where it will get the next instruction to be
executed

Program is passive stored in disk

Process is active

When the program is executed it will change it states

PCB- process control block

Context switch-

Threads

Multiple threads is a multiple executing engine

CPU bound short process compared to IO

Shared memory so we need to established a shared region

One process may have multiple task running a single time

One single ask running in sequential

1 tab 1 process

If we tap on something in a single tab, another thread will be created. More thread will be created if
we work on a single tab

The situation is possible because when the CPU switch to another process, the system will save state
of the current process and then load the saved state for the new process using the context switch

what happened when a computer is froze

If I am a computer mouse, I will not be working because it is tiring

Thread only inherited sources that allocated to the process

Cpu can only run single task

Quad core can run 4 task at a sametime

Thread

one to one

Many to many model

Thread cancellation
Gantt chart

P3 P2 P1
0 7 16 28

Waiting time for: P1 = 16, P2=7, P3= 0

Average waiting time = (7+16+0)/3= 7.67 msec


Gantt chart

P1 P2 P3
0 12 19 28

Waiting time for: P1 = 0, P2=12, P3= 19

Average waiting time = (0+12+19)/3= 10.3 msec


Gantt chart

P2 P3 P1
0 7 16 28

Waiting time for: P2 = 0, P3=7, P1= 16

Average waiting time = (0+7+16)/3= 7.67 msec

\
Gantt chart

P1 P2 P3 P2 P1
0 2 4 11 18 28

Waiting time for: P1 = 0, P2=7, P3= 16

Average waiting time = ((18))/3= 7.67 msec

You might also like