SlideShare a Scribd company logo
1 of 43
Download to read offline
Distributed Operating
Systems
Processes and Processors in Distributed Systems

Sandeep Kumar Poonia
Head of Dept. CS/IT
B.E., M.Tech., UGC-NET
LM-IAENG, LM-IACSIT,LM-CSTA, LM-AIRCC, LM-SCIEI, AM-UACEE
Processes and processors in distributed systems










Threads,
system model,
processor allocation,
scheduling in distributed systems
Load balancing and
sharing approach,
fault tolerance,
Real time distributed systems,
Process migration and related issues
Sandeep Kumar Poonia, Jagannath University, Jaipur
 In most traditional OS, each process has an

address space and a single thread of control.
 It is desirable to have multiple threads of control
sharing one address space but running in quasiparallel.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Introduction to threads
 Thread is a light weighted process.
 The analogy: thread is to process as process is to

machine.
• Each thread runs strictly sequentially and has its
own program counter and stack to keep track of
where it is.
• Threads share the CPU just as processes do: first
one thread runs, then another does.
• Threads can create child threads and can block
waiting for system calls to complete.
Sandeep Kumar Poonia, Jagannath University, Jaipur
Introduction to threads
 All threads have exactly the same address space. They

share code section, data section, and OS resources (open
files & signals). They share the same global variables. One
thread can read, write, or even completely wipe out
another thread’s stack.
 Threads can be in any one of several states: running,
blocked, ready, or terminated.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Introduction to threads
 There is no protection between threads:

(1) it is impossible
(2) it should not be necessary: a process is always owned
by a single user, who has created multiple threads so that
they can cooperate, not fight.
 In addition to sharing an address space all threads share :
 Set of open files
 Child processes

 Timers and Signals etc.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Threads
Computer

Sandeep Kumar Poonia, Jagannath University, Jaipur

Computer
Thread usage
Dispatcher/worker model
File server process

Dispatcher thread

Pipeline model

Worker
thread
Shared
block
cache

Request for Mailbox
work arrives

Team model

Sandeep Kumar Poonia, Jagannath University, Jaipur

Kernel
Advantages of using threads
1.

2.

3.

4.

Useful for clients: if a client wants a file to be
replicated on multiple servers, it can have one thread
talk to each server.
Handle signals, such as interrupts from the keyboard.
Instead of letting the signal interrupt the process, one
thread is dedicated full time to waiting for signals.
Producer-consumer problems are easier to implement
using threads because threads can share a common
buffer.
It is possible for threads in a single address space to
run in parallel, on different CPUs.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Design Issues for Threads Packages
 A set of primitives (e.g. library calls) available to

the user relating to threads is called a thread
package.
 Static thread: the choice of how many threads
there will be is made when the program is
written or when it is compiled. Each thread is
allocated a fixed stack. This approach is simple,
but inflexible.
 Dynamic thread: allow threads to be created
and destroyed on-the-fly during execution.
Sandeep Kumar Poonia, Jagannath University, Jaipur
Mutex
 If multiple threads want to access the shared

buffer, a mutex is used. A mutex can be locked or
unlocked.
 Mutexes are like binary semaphores: 0 or 1.
 Lock: if a mutex is already locked, the thread will be blocked.
 Unlock: unlocks a mutex. If one or more threads are waiting on

the mutex, exactly one of them is released. The rest continue to
wait.
 Trylock: if the mutex is locked, Trylock does not block the thread.
Instead, it returns a status code indicating failure.
Sandeep Kumar Poonia, Jagannath University, Jaipur
Implementing a threads package
 Implementing threads in user space

Sandeep Kumar Poonia, Jagannath University, Jaipur
Advantage
 User-level threads package can be implemented on an

operating system that does not support threads. For
example, the UNIX system.
 The threads run on top of a runtime system, which is a
collection of procedures that manage threads. The
runtime system does the thread switch. Store the old
environment and load the new one. It is much faster than
trapping to the kernel.
 User-level threads scale well. Kernel threads require
some table space and stack space in the kernel, which
can be a problem if there are a very large number of
threads.
Sandeep Kumar Poonia, Jagannath University, Jaipur
Disadvantage
 Blocking system calls are difficult to implement. Letting one thread

make a system call that will block the thread will stop all the threads.
 Page faults. If a thread causes a page faults, the kernel does not know
about the threads. It will block the entire process until the page has
been fetched, even though other threads might be runnable.
 If a thread starts running, no other thread in that process will ever run
unless the first thread voluntarily gives up the CPU.
 For the applications that are essentially CPU bound and rarely block,
there is no point of using threads. Because threads are most useful if
one thread is blocked, then another thread can be used.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Implementing threads in the kernel

Sandeep Kumar Poonia, Jagannath University, Jaipur
 The kernel knows about and manages the threads. No

runtime system is needed. When a thread wants to create
a new thread or destroy an existing thread, it makes a
kernel call, which then does the creation and
destruction.
 To manage all the threads, the kernel has one table per
process with one entry per thread.
 When a thread blocks, the kernel can run either another
thread from the same process or a thread from a
different process.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Scheduler Activations
 Scheduler activations combine the advantage of user

threads (good performance) and kernel threads.
 The goals of the scheduler activation are to mimic the
functionality of kernel threads, but with the better
performance and greater flexibility usually associated
with threads packages implemented in user space.
 Efficiency is achieved by avoiding unnecessary transitions
between user and kernel space. If a thread blocks, the
user-space runtime system can schedule a new one by
itself.
Sandeep Kumar Poonia, Jagannath University, Jaipur
 Disadvantage:

Upcall from the kernel to the runtime system violates the
structure in the layered system.

Sandeep Kumar Poonia, Jagannath University, Jaipur
System Models
 The workstation model:

the system consists of workstations scattered throughout
a building or campus and connected by a high-speed
LAN.
The systems in which workstations have local disks are
called diskful workstations. Otherwise, diskless
workstations.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Why diskless workstation?
 If the workstations are diskless, the file system must be

implemented by one or more remote file servers.
Diskless workstations are cheaper.
 Ease of installing new release of program on several
servers than on hundreds of machines. Backup and
hardware maintenance is also simpler.
 Diskless does not have fans and noises.
 Diskless provides symmetry and flexibility. You can use
any machine and access your files because all the files are
in the server.
Sandeep Kumar Poonia, Jagannath University, Jaipur
 Advantage: low cost, easy hardware and software

maintenance, symmetry and flexibility.
 Disadvantage: heavy network usage; file servers may
become bottlenecks.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Diskful workstations
The disks in the diskful workstation are used in one
of the four ways:
Paging and temporary files (temporary files generated by the
compiler passes).
Advantage: reduces network load over diskless case
Disadvantage: higher cost due to large number of disks needed
2. Paging, temporary files, and system binaries (binary
executable programs such as the compilers, text editors, and
electronic mail handlers).
Advantage: reduces network load even more
Disadvantage: higher cost; additional complexity of updating the binaries
1.

Sandeep Kumar Poonia, Jagannath University, Jaipur
3.Paging, temporary files, system binaries, and file caching
(download the file from the server and cache it in the local disk.
Can make modifications and write back. Problem is cache
coherence).
Advantage: still lower network load; reduces load on file servers as
well
Disadvantage: higher cost; cache consistency problems
4.Complete local file system (low network traffic but sharing is
difficult).
Advantage: hardly any network load; eliminates need for file servers
Disadvantage: loss of transparency

Sandeep Kumar Poonia, Jagannath University, Jaipur
Sandeep Kumar Poonia, Jagannath University, Jaipur
Using Idle Workstation
 The earliest attempt to use idle workstations is

command:
 rsh machine command
 The first argument names a machine and the

second names a command to run.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Flaws
1) User has to tell which machine to use.
2) The program executes in a different environment than the
local one.
3) Maybe log in to an idle machine with many processes.

Sandeep Kumar Poonia, Jagannath University, Jaipur
What is an idle workstation?
 If no one has touched the keyboard or mouse for several minutes

and no user-initiated processes are running, the workstation can
be said to be idle.
 The algorithms used to locate idle workstations can be divided
into two categories:
 server driven--if a server is idle, it registers in registry file or
broadcasts to every machine.
 client driven --the client broadcasts a request asking for the
specific machine that it needs and wait for the reply.

Sandeep Kumar Poonia, Jagannath University, Jaipur
A registry-based algorithm for finding &
using idle workstation

Sandeep Kumar Poonia, Jagannath University, Jaipur
How to run the process remotely?
 To start with, it needs the same view of the file system, the

same working directory, and the same environment
variables.
 Some system calls can be done remotely but some can not.
For example, read from keyboard and write to the screen
can never be carried out on remote machine. (All system
calls that query the state of machine)
 Some must be done remotely, such as the UNIX system calls
SBRK (adjust the size of the data segment), NICE (set CPU
scheduling priority), and PROFIL (enable profiling of the
program counter).
Sandeep Kumar Poonia, Jagannath University, Jaipur
The processor pool model
 A processor pool is a rack full of CPUs in the machine

room, which can be dynamically allocated to users on
demand.

Sandeep Kumar Poonia, Jagannath University, Jaipur
 Why processor pool?
 Input rate λ, process rate µ. mean response time T=1/(µ-

λ).
 If there are n processors, each with input rate λ and process
rate µ.
 If we put them together, input rate will be nλ and process
rate will be nµ. Mean response time will be T1=1/(nµnλ)=T/n.

User generate a total of λ
request/sec

Sandeep Kumar Poonia, Jagannath University, Jaipur
Example
 Consider a file server that is handling 50

request/sec (µ)
 But get only 40 request/sec(λ)
 The Mean Response time?
 If λ

go to 0 (no load)
 What will be response time?

Sandeep Kumar Poonia, Jagannath University, Jaipur
A hybrid model
 A possible compromise is to provide each user

with a personal workstation and to have a
processor pool in addition.
 For the hybrid model, even if you can not get any
processor from the processor pool, at least you
have the workstation to do the work.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Processor Allocation
Determine which process is assigned to which
processor. Also called load distribution.
Two categories:
 Static load distribution-nonmigratory, once
allocated, can not move, no matter how
overloaded the machine is.
 Dynamic load distribution-migratory, can move
even if the execution started. But algorithm is
complex.
Sandeep Kumar Poonia, Jagannath University, Jaipur
The goals of allocation
1 Maximize CPU utilization
2 Minimize mean response time/ Minimize response ratio
Response ratio-the amount of time it takes to run a process on some
machine, divided by how long it would take on some unloaded
benchmark processor. E.g. a 1-sec job that takes 5 sec. The ratio is
5/1.

Sandeep Kumar Poonia, Jagannath University, Jaipur
Design issues for processor allocation
algorithms
 Deterministic versus heuristic algorithms

 Centralized versus distributed algorithms
 Optimal versus suboptimal algorithms
 Local versus global algorithms

 Sender-initiated versus receiver-initiated algorithms

Sandeep Kumar Poonia, Jagannath University, Jaipur
How to measure a processor is overloaded or
underloaded?
1 Count the processes in the machine? Not accurate
because even the machine is idle there are some daemons
running.
2 Count only the running or ready to run processes? Not
accurate because some daemons just wake up and check
to see if there is anything to run, after that, they go to
sleep.That puts a small load on the system.
3 Check the fraction of time the CPU is busy using time
interrupts. Not accurate because when CPU is busy it
sometimes disable interrupts.
Sandeep Kumar Poonia, Jagannath University, Jaipur
 How to deal with overhead?
A proper algorithm should take into account the CPU time,
memory usage, and network bandwidth consumed by the
processor allocation algorithm itself.

 How to calculate complexity?
If an algorithm performs a little better than others but requires
much complex implementation, better use the simple one.

 How to deal with stability?
Problems can arise if the state of the machine is not stable yet,
still in the process of updating.
Sandeep Kumar Poonia, Jagannath University, Jaipur
Load distribution based on precedence
graph
P1
T1
2

T1
T2

1

1

T2 1
1
T3

T4
2

2 T4

4

Time

T3

1

2

P2

2
4
T5

Sandeep Kumar Poonia, Jagannath University, Jaipur

T5
T1

T2

T1

d

T1

T2

d

T3

T3

Sandeep Kumar Poonia, Jagannath University, Jaipur

T1

T1

T2

T2

T3

d
T3
Two Optimal Scheduling Algorithms
 The precedence graph is a tree

T1

T2

T5

T3

T4
5
T7

T6
T9
T8

T10

T11

4
3

T12
2
1

Sandeep Kumar Poonia, Jagannath University, Jaipur
T13

T1
T4
T6
T8
T11
T13

T2
T5
T9
T12

T3
T7
T10
 There are only two processors

T9

T10

T11
7

T7 9

8 T8

T6 6
T4 4

T5 5

1
2
3
Sandeep Kumar Poonia, Jagannath University, Jaipur
T1
T3
T2

T10

T7

T8

T11

10

T9

T6

T5

T4

T3

11

T2

T1
A graph-theoretic deterministic
algorithm
A
2
6

B

3

4

3

G

4

F

E

3

2

Total network traffic: 2+4+3+4+2+8+5+2
4 =30

5
2

1
1
H

F

I

C

4
4

D

5

1

B

2

3

8

H

A

G

1

E 2

C

2

D

8

Total network traffic: 3+2+4+4+3+5+5+
= 28

5
5
2

Sandeep Kumar Poonia, Jagannath University, Jaipur

I

More Related Content

What's hot

Communications is distributed systems
Communications is distributed systemsCommunications is distributed systems
Communications is distributed systemsSHATHAN
 
Processor Allocation (Distributed computing)
Processor Allocation (Distributed computing)Processor Allocation (Distributed computing)
Processor Allocation (Distributed computing)Sri Prasanna
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating SystemsDr Sandeep Kumar Poonia
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed SystemsPritom Saha Akash
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithmBushra M
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationMNM Jain Engineering College
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architectureMaulik Togadiya
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systemsmridul mishra
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure callSunita Sahu
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process CommunicationAdeel Rasheed
 
Election algorithms
Election algorithmsElection algorithms
Election algorithmsAnkush Kumar
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software conceptsPrajakta Rane
 
Key management and distribution
Key management and distributionKey management and distribution
Key management and distributionRiya Choudhary
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSDr. SELVAGANESAN S
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemorySHIKHA GAUTAM
 

What's hot (20)

Communications is distributed systems
Communications is distributed systemsCommunications is distributed systems
Communications is distributed systems
 
Processor Allocation (Distributed computing)
Processor Allocation (Distributed computing)Processor Allocation (Distributed computing)
Processor Allocation (Distributed computing)
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 
11. dfs
11. dfs11. dfs
11. dfs
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architecture
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systems
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Election algorithms
Election algorithmsElection algorithms
Election algorithms
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
 
Key management and distribution
Key management and distributionKey management and distribution
Key management and distribution
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 

Similar to Distributed Operating Systems Processes and Processors

Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating SystemProcess, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating SystemLieYah Daliah
 
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Kasun Gajasinghe
 
Unit 2 part 2(Process)
Unit 2 part 2(Process)Unit 2 part 2(Process)
Unit 2 part 2(Process)WajeehaBaig
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)Prakhar Maurya
 
Operating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxOperating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxPrudhvi668506
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programmingAnyapuPranav
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcbKanza batool
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptxbleh23
 
Operating system (OS) itself is a process, what approaches are there.pdf
Operating system (OS) itself is a process, what approaches are there.pdfOperating system (OS) itself is a process, what approaches are there.pdf
Operating system (OS) itself is a process, what approaches are there.pdfJUSTSTYLISH3B2MOHALI
 

Similar to Distributed Operating Systems Processes and Processors (20)

4.Process.ppt
4.Process.ppt4.Process.ppt
4.Process.ppt
 
Threads
ThreadsThreads
Threads
 
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating SystemProcess, Threads, Symmetric Multiprocessing and Microkernels in Operating System
Process, Threads, Symmetric Multiprocessing and Microkernels in Operating System
 
Threads ppt
Threads pptThreads ppt
Threads ppt
 
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
Scheduler Activations - Effective Kernel Support for the User-Level Managemen...
 
Threads
ThreadsThreads
Threads
 
thread os.pptx
thread os.pptxthread os.pptx
thread os.pptx
 
Unit 2 part 2(Process)
Unit 2 part 2(Process)Unit 2 part 2(Process)
Unit 2 part 2(Process)
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 
Operating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptxOperating Systems R20 Unit 2.pptx
Operating Systems R20 Unit 2.pptx
 
Wiki 2
Wiki 2Wiki 2
Wiki 2
 
Sucet os module_2_notes
Sucet os module_2_notesSucet os module_2_notes
Sucet os module_2_notes
 
Multi threaded programming
Multi threaded programmingMulti threaded programming
Multi threaded programming
 
Thread
ThreadThread
Thread
 
Concept of thread, multi thread, tcb
Concept of thread, multi thread, tcbConcept of thread, multi thread, tcb
Concept of thread, multi thread, tcb
 
Thread
ThreadThread
Thread
 
OS Module-2.pptx
OS Module-2.pptxOS Module-2.pptx
OS Module-2.pptx
 
Assignment-01.pptx
Assignment-01.pptxAssignment-01.pptx
Assignment-01.pptx
 
Memory management
Memory managementMemory management
Memory management
 
Operating system (OS) itself is a process, what approaches are there.pdf
Operating system (OS) itself is a process, what approaches are there.pdfOperating system (OS) itself is a process, what approaches are there.pdf
Operating system (OS) itself is a process, what approaches are there.pdf
 

More from Dr Sandeep Kumar Poonia

An improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmAn improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmDr Sandeep Kumar Poonia
 
Modified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmModified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmDr Sandeep Kumar Poonia
 
Enhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmEnhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmDr Sandeep Kumar Poonia
 
Memetic search in differential evolution algorithm
Memetic search in differential evolution algorithmMemetic search in differential evolution algorithm
Memetic search in differential evolution algorithmDr Sandeep Kumar Poonia
 
Improved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmImproved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmDr Sandeep Kumar Poonia
 
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmComparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmDr Sandeep Kumar Poonia
 
A novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmA novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmDr Sandeep Kumar Poonia
 
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsMultiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsDr Sandeep Kumar Poonia
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmDr Sandeep Kumar Poonia
 
New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm Dr Sandeep Kumar Poonia
 
Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Dr Sandeep Kumar Poonia
 
Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Dr Sandeep Kumar Poonia
 

More from Dr Sandeep Kumar Poonia (20)

Soft computing
Soft computingSoft computing
Soft computing
 
An improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithmAn improved memetic search in artificial bee colony algorithm
An improved memetic search in artificial bee colony algorithm
 
Modified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithmModified position update in spider monkey optimization algorithm
Modified position update in spider monkey optimization algorithm
 
Enhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithmEnhanced local search in artificial bee colony algorithm
Enhanced local search in artificial bee colony algorithm
 
RMABC
RMABCRMABC
RMABC
 
Memetic search in differential evolution algorithm
Memetic search in differential evolution algorithmMemetic search in differential evolution algorithm
Memetic search in differential evolution algorithm
 
Improved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithmImproved onlooker bee phase in artificial bee colony algorithm
Improved onlooker bee phase in artificial bee colony algorithm
 
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithmComparative study of_hybrids_of_artificial_bee_colony_algorithm
Comparative study of_hybrids_of_artificial_bee_colony_algorithm
 
A novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithmA novel hybrid crossover based abc algorithm
A novel hybrid crossover based abc algorithm
 
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked listsMultiplication of two 3 d sparse matrices using 1d arrays and linked lists
Multiplication of two 3 d sparse matrices using 1d arrays and linked lists
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
 
New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm New Local Search Strategy in Artificial Bee Colony Algorithm
New Local Search Strategy in Artificial Bee Colony Algorithm
 
A new approach of program slicing
A new approach of program slicingA new approach of program slicing
A new approach of program slicing
 
Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...Performance evaluation of different routing protocols in wsn using different ...
Performance evaluation of different routing protocols in wsn using different ...
 
Enhanced abc algo for tsp
Enhanced abc algo for tspEnhanced abc algo for tsp
Enhanced abc algo for tsp
 
Database aggregation using metadata
Database aggregation using metadataDatabase aggregation using metadata
Database aggregation using metadata
 
Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...Performance evaluation of diff routing protocols in wsn using difft network p...
Performance evaluation of diff routing protocols in wsn using difft network p...
 
Lecture28 tsp
Lecture28 tspLecture28 tsp
Lecture28 tsp
 
Lecture27 linear programming
Lecture27 linear programmingLecture27 linear programming
Lecture27 linear programming
 
Lecture26
Lecture26Lecture26
Lecture26
 

Recently uploaded

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Recently uploaded (20)

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

Distributed Operating Systems Processes and Processors

  • 1. Distributed Operating Systems Processes and Processors in Distributed Systems Sandeep Kumar Poonia Head of Dept. CS/IT B.E., M.Tech., UGC-NET LM-IAENG, LM-IACSIT,LM-CSTA, LM-AIRCC, LM-SCIEI, AM-UACEE
  • 2. Processes and processors in distributed systems          Threads, system model, processor allocation, scheduling in distributed systems Load balancing and sharing approach, fault tolerance, Real time distributed systems, Process migration and related issues Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 3.  In most traditional OS, each process has an address space and a single thread of control.  It is desirable to have multiple threads of control sharing one address space but running in quasiparallel. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 4. Introduction to threads  Thread is a light weighted process.  The analogy: thread is to process as process is to machine. • Each thread runs strictly sequentially and has its own program counter and stack to keep track of where it is. • Threads share the CPU just as processes do: first one thread runs, then another does. • Threads can create child threads and can block waiting for system calls to complete. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 5. Introduction to threads  All threads have exactly the same address space. They share code section, data section, and OS resources (open files & signals). They share the same global variables. One thread can read, write, or even completely wipe out another thread’s stack.  Threads can be in any one of several states: running, blocked, ready, or terminated. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 6. Introduction to threads  There is no protection between threads: (1) it is impossible (2) it should not be necessary: a process is always owned by a single user, who has created multiple threads so that they can cooperate, not fight.  In addition to sharing an address space all threads share :  Set of open files  Child processes  Timers and Signals etc. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 7. Threads Computer Sandeep Kumar Poonia, Jagannath University, Jaipur Computer
  • 8. Thread usage Dispatcher/worker model File server process Dispatcher thread Pipeline model Worker thread Shared block cache Request for Mailbox work arrives Team model Sandeep Kumar Poonia, Jagannath University, Jaipur Kernel
  • 9. Advantages of using threads 1. 2. 3. 4. Useful for clients: if a client wants a file to be replicated on multiple servers, it can have one thread talk to each server. Handle signals, such as interrupts from the keyboard. Instead of letting the signal interrupt the process, one thread is dedicated full time to waiting for signals. Producer-consumer problems are easier to implement using threads because threads can share a common buffer. It is possible for threads in a single address space to run in parallel, on different CPUs. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 10. Design Issues for Threads Packages  A set of primitives (e.g. library calls) available to the user relating to threads is called a thread package.  Static thread: the choice of how many threads there will be is made when the program is written or when it is compiled. Each thread is allocated a fixed stack. This approach is simple, but inflexible.  Dynamic thread: allow threads to be created and destroyed on-the-fly during execution. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 11. Mutex  If multiple threads want to access the shared buffer, a mutex is used. A mutex can be locked or unlocked.  Mutexes are like binary semaphores: 0 or 1.  Lock: if a mutex is already locked, the thread will be blocked.  Unlock: unlocks a mutex. If one or more threads are waiting on the mutex, exactly one of them is released. The rest continue to wait.  Trylock: if the mutex is locked, Trylock does not block the thread. Instead, it returns a status code indicating failure. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 12. Implementing a threads package  Implementing threads in user space Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 13. Advantage  User-level threads package can be implemented on an operating system that does not support threads. For example, the UNIX system.  The threads run on top of a runtime system, which is a collection of procedures that manage threads. The runtime system does the thread switch. Store the old environment and load the new one. It is much faster than trapping to the kernel.  User-level threads scale well. Kernel threads require some table space and stack space in the kernel, which can be a problem if there are a very large number of threads. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 14. Disadvantage  Blocking system calls are difficult to implement. Letting one thread make a system call that will block the thread will stop all the threads.  Page faults. If a thread causes a page faults, the kernel does not know about the threads. It will block the entire process until the page has been fetched, even though other threads might be runnable.  If a thread starts running, no other thread in that process will ever run unless the first thread voluntarily gives up the CPU.  For the applications that are essentially CPU bound and rarely block, there is no point of using threads. Because threads are most useful if one thread is blocked, then another thread can be used. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 15. Implementing threads in the kernel Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 16.  The kernel knows about and manages the threads. No runtime system is needed. When a thread wants to create a new thread or destroy an existing thread, it makes a kernel call, which then does the creation and destruction.  To manage all the threads, the kernel has one table per process with one entry per thread.  When a thread blocks, the kernel can run either another thread from the same process or a thread from a different process. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 17. Scheduler Activations  Scheduler activations combine the advantage of user threads (good performance) and kernel threads.  The goals of the scheduler activation are to mimic the functionality of kernel threads, but with the better performance and greater flexibility usually associated with threads packages implemented in user space.  Efficiency is achieved by avoiding unnecessary transitions between user and kernel space. If a thread blocks, the user-space runtime system can schedule a new one by itself. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 18.  Disadvantage: Upcall from the kernel to the runtime system violates the structure in the layered system. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 19. System Models  The workstation model: the system consists of workstations scattered throughout a building or campus and connected by a high-speed LAN. The systems in which workstations have local disks are called diskful workstations. Otherwise, diskless workstations. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 20. Why diskless workstation?  If the workstations are diskless, the file system must be implemented by one or more remote file servers. Diskless workstations are cheaper.  Ease of installing new release of program on several servers than on hundreds of machines. Backup and hardware maintenance is also simpler.  Diskless does not have fans and noises.  Diskless provides symmetry and flexibility. You can use any machine and access your files because all the files are in the server. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 21.  Advantage: low cost, easy hardware and software maintenance, symmetry and flexibility.  Disadvantage: heavy network usage; file servers may become bottlenecks. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 22. Diskful workstations The disks in the diskful workstation are used in one of the four ways: Paging and temporary files (temporary files generated by the compiler passes). Advantage: reduces network load over diskless case Disadvantage: higher cost due to large number of disks needed 2. Paging, temporary files, and system binaries (binary executable programs such as the compilers, text editors, and electronic mail handlers). Advantage: reduces network load even more Disadvantage: higher cost; additional complexity of updating the binaries 1. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 23. 3.Paging, temporary files, system binaries, and file caching (download the file from the server and cache it in the local disk. Can make modifications and write back. Problem is cache coherence). Advantage: still lower network load; reduces load on file servers as well Disadvantage: higher cost; cache consistency problems 4.Complete local file system (low network traffic but sharing is difficult). Advantage: hardly any network load; eliminates need for file servers Disadvantage: loss of transparency Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 24. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 25. Using Idle Workstation  The earliest attempt to use idle workstations is command:  rsh machine command  The first argument names a machine and the second names a command to run. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 26. Flaws 1) User has to tell which machine to use. 2) The program executes in a different environment than the local one. 3) Maybe log in to an idle machine with many processes. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 27. What is an idle workstation?  If no one has touched the keyboard or mouse for several minutes and no user-initiated processes are running, the workstation can be said to be idle.  The algorithms used to locate idle workstations can be divided into two categories:  server driven--if a server is idle, it registers in registry file or broadcasts to every machine.  client driven --the client broadcasts a request asking for the specific machine that it needs and wait for the reply. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 28. A registry-based algorithm for finding & using idle workstation Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 29. How to run the process remotely?  To start with, it needs the same view of the file system, the same working directory, and the same environment variables.  Some system calls can be done remotely but some can not. For example, read from keyboard and write to the screen can never be carried out on remote machine. (All system calls that query the state of machine)  Some must be done remotely, such as the UNIX system calls SBRK (adjust the size of the data segment), NICE (set CPU scheduling priority), and PROFIL (enable profiling of the program counter). Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 30. The processor pool model  A processor pool is a rack full of CPUs in the machine room, which can be dynamically allocated to users on demand. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 31.  Why processor pool?  Input rate λ, process rate µ. mean response time T=1/(µ- λ).  If there are n processors, each with input rate λ and process rate µ.  If we put them together, input rate will be nλ and process rate will be nµ. Mean response time will be T1=1/(nµnλ)=T/n. User generate a total of λ request/sec Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 32. Example  Consider a file server that is handling 50 request/sec (µ)  But get only 40 request/sec(λ)  The Mean Response time?  If λ go to 0 (no load)  What will be response time? Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 33. A hybrid model  A possible compromise is to provide each user with a personal workstation and to have a processor pool in addition.  For the hybrid model, even if you can not get any processor from the processor pool, at least you have the workstation to do the work. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 34. Processor Allocation Determine which process is assigned to which processor. Also called load distribution. Two categories:  Static load distribution-nonmigratory, once allocated, can not move, no matter how overloaded the machine is.  Dynamic load distribution-migratory, can move even if the execution started. But algorithm is complex. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 35. The goals of allocation 1 Maximize CPU utilization 2 Minimize mean response time/ Minimize response ratio Response ratio-the amount of time it takes to run a process on some machine, divided by how long it would take on some unloaded benchmark processor. E.g. a 1-sec job that takes 5 sec. The ratio is 5/1. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 36. Design issues for processor allocation algorithms  Deterministic versus heuristic algorithms  Centralized versus distributed algorithms  Optimal versus suboptimal algorithms  Local versus global algorithms  Sender-initiated versus receiver-initiated algorithms Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 37. How to measure a processor is overloaded or underloaded? 1 Count the processes in the machine? Not accurate because even the machine is idle there are some daemons running. 2 Count only the running or ready to run processes? Not accurate because some daemons just wake up and check to see if there is anything to run, after that, they go to sleep.That puts a small load on the system. 3 Check the fraction of time the CPU is busy using time interrupts. Not accurate because when CPU is busy it sometimes disable interrupts. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 38.  How to deal with overhead? A proper algorithm should take into account the CPU time, memory usage, and network bandwidth consumed by the processor allocation algorithm itself.  How to calculate complexity? If an algorithm performs a little better than others but requires much complex implementation, better use the simple one.  How to deal with stability? Problems can arise if the state of the machine is not stable yet, still in the process of updating. Sandeep Kumar Poonia, Jagannath University, Jaipur
  • 39. Load distribution based on precedence graph P1 T1 2 T1 T2 1 1 T2 1 1 T3 T4 2 2 T4 4 Time T3 1 2 P2 2 4 T5 Sandeep Kumar Poonia, Jagannath University, Jaipur T5
  • 40. T1 T2 T1 d T1 T2 d T3 T3 Sandeep Kumar Poonia, Jagannath University, Jaipur T1 T1 T2 T2 T3 d T3
  • 41. Two Optimal Scheduling Algorithms  The precedence graph is a tree T1 T2 T5 T3 T4 5 T7 T6 T9 T8 T10 T11 4 3 T12 2 1 Sandeep Kumar Poonia, Jagannath University, Jaipur T13 T1 T4 T6 T8 T11 T13 T2 T5 T9 T12 T3 T7 T10
  • 42.  There are only two processors T9 T10 T11 7 T7 9 8 T8 T6 6 T4 4 T5 5 1 2 3 Sandeep Kumar Poonia, Jagannath University, Jaipur T1 T3 T2 T10 T7 T8 T11 10 T9 T6 T5 T4 T3 11 T2 T1
  • 43. A graph-theoretic deterministic algorithm A 2 6 B 3 4 3 G 4 F E 3 2 Total network traffic: 2+4+3+4+2+8+5+2 4 =30 5 2 1 1 H F I C 4 4 D 5 1 B 2 3 8 H A G 1 E 2 C 2 D 8 Total network traffic: 3+2+4+4+3+5+5+ = 28 5 5 2 Sandeep Kumar Poonia, Jagannath University, Jaipur I