SlideShare uma empresa Scribd logo
1 de 55
Debasis Das
Mutual Exclusion
CS 704D Advanced OS 2
Complexities
In distributed systems
 Absence of shared memory
 Inter-node communication delays can be considerable
 Global system state cannot be observed by constituent
machines due to communication delays, component
failures, absence of shared memory
 Many more modes of failures yet fail soft is a goal
CS 704D Advanced OS 3
Some Considerations
 Policies/strategies developed for a distributed system
can be made applicable in a uniprocessor case
 However, policies/strategies developed for
uniprocessor case cannot be extended to distributed
case
 Same can be simulated by adding a central resources
allocator
 Increase traffic to central allocator, the system will fail
when the allocator fails
 Election of a successor would be needed
CS 704D Advanced OS 4
Required Assumptions
 Messages exchanged by a pair of communicating
processes need to be received in the same order as they
were generated (pipelining property)
 Every message is received without errors, no duplicates
 The underlying network ensures all nodes are fully
connected. Any node can communicate with every
other node
CS 704D Advanced OS 5
Desirable Properties
of Algorithms
 All nodes should have equal amount of information
 Each node makes decisions on the basis of local
information. The algorithm should ensure that nodes
make consistent & coherent decisions
 All nodes reach decisions through about equal effort
 Failure of a node should not cause complete break
down. The ability of reaching a decision and accessing
the resources should not be affected
CS 704D Advanced OS 6
Time & Ordering of Events
Happened Before Relationship
 Logical clock needs to ensure
 If a and b are events in the same process and a comes
before b then a->b
 If event a is a representation of sending of a message
and b is that of receiving of message in another process
the a->b
 It is a transitive relationship; that is if a->b and b->c
then a->c
 If a and b has no happened before relationship the a and
b are said to be concurrent
CS 704D Advanced OS 7
Time & Ordering of Events
Logical Clock Properties
 If a->b the C(a) < C(b)
 Clock condition is satisfied if
 If a and b are events in a process Pi and if a comes before
b the Ci(a)< Ci(b)
 If a is an event sending message m by process Pi and b is
the receipt of message by process Pj then Ci(a) <Cj(b)
CS 704D Advanced OS 8
Time & Ordering of Events
Logical Clock Implementation
 Process Pi increments the clock Ci between successive
events
 Message m needs to be time stamped so that
T(m)=ci(a)
 Receiving process adjusts clock such that it is max of
(Cj+1, Tm)
CS 704D Advanced OS 9
Total Ordering
 ab only when
 Ci(a) “less than” Cj(b) or
 Ci(a) = Cj(b) and Pi “less than” Pj
 Simple way to implement “less than” relation would be
to assign a unique number to each process and define
the “less than” such that i < j.
CS 704D Advanced OS 10
Lamport’s Algorithm
 Initiator i: Process Pi requires an exclusive access to a resource. Sends
time stamped message request (Ti, i) where Ti = Ci to all the other
processes.
 Other processes(j, j not= i): When Pj receives the request, places the
request on its own queue, send a reply with time stamp (Tj, j) to
Process Pi
 Pi is allowed access only when
 Pi request is in front of the queue and
 All replies are time stamped later that the Pi time stamp
 Pi sends a release message by sending a release message, time stamped
suitably
 Pj removes Pi request from it request queue
Cost: 3 (N-1) messages, works best on bus based system where broadcast
costs are minimal
CS 704D Advanced OS 11
Ricart-Agarwala Algorithm
 Initiator i: Process Pi requires an exclusive access to a resource. Sends
time stamped message request (Ti, i) where Ti = Ci to all the other
processes.
 Other processes(j, j not= i): When Pj receives the request reacts as
follows,
 If Pj is not requesting the resource, it sends a time stamped reply
 If Pj needs the resource and the time stamp precedes the Pi’s time stamp
Pi’s request is retained, else a time stamped reply is returned.
 Pi is allowed access only when
 Pi request is in front of the queue and
 All replies are time stamped later that the Pi time stamp
 Pi sends a releases resource by sending a release message, for each
pending resources
Cost: 2(N-1) messages
CS 704D Advanced OS 12
Distributed Shared Memory
 A software abstraction over the loosely coupled
systems
 Provides a shared memory kind of operation over the
underlying IPC/RPC mechanisms
 Can be implemented in OS kernel or runtime system
 Also known as Distributed Shared Virtual Memory
System (DSVM)
 The shared space exists only virtually
CS 704D Advanced OS 13
DSM Architecture
CS 704D Advanced OS 14
Distributed Shared Memory Layer
Memory
Mapping
CPU(s)
Memory
Mapping
CPU(s)
Memory
Mapping
CPU(s)
Communication Network
DSM Architecture
 Unlike tightly coupled systems, this shared memory is
entirely virtual
 Partitioned into blocks
 Local memory is treated as large local caches
 If the data requested is not available locally a network fault
is generated
 OS, through a message, requests the node holding the
block and gets it migrated to the node where fault occurred
 Data may be replicated locally
 Configuration varies depending on what kind of
replication, migration policies are used
CS 704D Advanced OS 15
Design issues
 Granularity (block size): Smaller size, higher faults,
traffic; larger blocks mean jobs with higher locality
 Structure: Layout of data, depends on application
 Coherence & access synchronization: Like the cache
situation in a uniprocessor system
 Data Location & access: what data to be replicated,
located
 Replacement strategy
 Thrashing
 Heterogeneity
CS 704D Advanced OS 16
Granularity
CS 704D Advanced OS 17
Block Size Selection Factors
 Large block sizes favored as overheads to transfer
smaller blocks and larger one not too different
 Paging overhead- paging overheads also favors larger
block sizes, application should thus have larger locality
of reference
 Directory size-smaller block larger directory, larger
management overhead
 Thrashing- thrashing is likely to increase with larger
block size
 False sharing-larger block sizes increases probability.
Consequence, higher thrashing
CS 704D Advanced OS 18
Page Size as Block Size
 Page size is preferred as the DSM block size
 Advantages are
 Existing page fault hardware can be used as block fault
mechanism. Memory coherence can be handled in page
fault handlers
 Access control can be managed with existing memory
mapping systems
 If page size is less than packet size, no extra overhead
 Page size proved to be, over time, the right unit as far as
memory contention
CS 704D Advanced OS 19
Structure
CS 704D Advanced OS 20
Structure of Shared Memory
Space
 Approaches to structuring
 No structure: a linear array of memory, easy to design
 By data type: granularity per variable, complex to
handle
 As database: as tuple space, associative memory,
primitives need to be added to languages, non
transparent access to shared data
CS 704D Advanced OS 21
Consistency Models
CS 704D Advanced OS 22
Consistency Models
 Strict consistency
 Sequential consistency
 Causal consistency
 Pipelined random access memory consistency
 Processor consistency
 Weak consistency
 Release consistency
CS 704D Advanced OS 23
Strict Consistency Model
 Value read of a memory address is the same as the
latest write at that address
 Writes become visible to all nodes
 Needs absolute ordering of memory read/write
operations, a global time required (to define most
recent)
 Nearly impossible to implement
CS 704D Advanced OS 24
Sequential Consistency Model
 All processes should see the same ordering of read,
writes
 Exact interleaving does not matter
 No memory operation is started unless earlier
operations have completed
 Acceptable in most applications
CS 704D Advanced OS 25
Causal Consistency Model
 Operations are seen in same order (correct order)when
they are causally related
 W2 follows w1 and causally related, then w1, w2 is the
order every process should see
 They may not be seen in same order when not related
causally
CS 704D Advanced OS 26
Pipelined RAM Consistency Model
 All writes of a single process are seen in the same order
by other processes (as in a pipeline)
 However, writes by other processes may appear in
different order.
 (W11,w12) and (w21, w22) can be seen as (wi1,wi2)
followed by (w21, w22) or (w21, w22) followed by
(w11,w12)
 Simple to implement
CS 704D Advanced OS 27
Processor Consistency Model
 Adds memory coherence to the PRAM model
 That is if the writes are for a particular memory
location then all processes should see the writes in the
same order that maintains memory coherence
CS 704D Advanced OS 28
Weak Consistency Model
 Changes in memory can be made after a set of changes has happened (example critical
section)
 Isolated access to variable is usually rare, usually there will be several accesses and then
none at all
 Difficulty is the system would not know when to show the changes
 Application programmers can take care of this through a synchronization variable
 Necessarily
 All accesses to sync variable must follow strongest consistency9sequential)
 All pending writes must be completed before access to sync variable is allowed
 All previous access to sync must be completed before another access is allowed
CS 704D Advanced OS 29
Release Consistency Model
 Weak consistency model requires that
 All changes made by a process are propagated to all
nodes
 All changes at other nodes are propagated to the
processor node
 Acquire and release variable used for sync so that only
one of the operations above need to be done
CS 704D Advanced OS 30
Discussion of Models
 Strict sequential model s difficult to implement,
almost never implemented
 Sequential consistency model is most commonly used
 Causal, PRAM, processor, weak and release
consistency are the ones implemented in many DSM
systems, programmers need to intervene
 Weak and release consistency provides explicit sync
variables to help with the consistency
CS 704D Advanced OS 31
Implementing Sequential
Concurrency Model
 Implementing sequential consistency would depend
on what replication/ migration are allowed
 Migration/Replication strategies
 Non replicated, non migrating blocks (NRNMBs)
 Non replicated, migrating blocks (NRMBs)
 Replicated, migrating blocks (RMBs)
 Replicated, non migrating blocks (RNMBs)
CS 704D Advanced OS 32
NRNMB
 All requests to a block are routed through the OS and
MMU to this one block that is not replicate and does
not move anywhere
 Can cause
 Bottleneck because of serializing of memory accesses
 Parallelism is not possible
CS 704D Advanced OS 33
NRMB
 No copies, if required entire block may be moved to
the node that requires it
 Advantages
 No communication costs, all accesses are local
 Applications can take advantage of locality, applications
with high locality will perform better
 Disadvantages
 Prone to thrashing
 No advantage of parallelism
CS 704D Advanced OS 34
Data Locating in NRMB
 Broadcast
 Fault happens, a request is broadcast, current owner sends
the block
 Broadcast cause communication overheads
 Centralized server
 Request sent to the server, servers asks the node holding the
block to send it to the requesting node, updates location
information
 Fixed distributed server
 Fault handler finds mapping of block to the specific server, send
request and gets the block
 Dynamic distributed server
 Fault causes a local search for probable owner, goes to that node,
finds another probable owner or the block, gets block updates info
CS 704D Advanced OS 35
RMB
 Replication is required to increase parallelism
 Reads can be done locally, writes has overheads
 High read/write ratio systems can apportion the write
overhead over many reads
 Maintaining coherence throughout replicated block is
an issue
 Two basic protocols used are
 Write-invalidate
 Write update
CS 704D Advanced OS 36
Coherence Protocols
 Write-invalidate
 On write fault, the fault handler copies the block from
one of the nodes to its own
 Invalidates all the copies, writes data
 If another node needs it now, the updated block is
replicated
 Write update
 On write fault, copy block to local node, update data
 Send address & new data to all the replicas
 Operation resumes after all the writes are done
CS 704D Advanced OS 37
Comparison
 Write update typically needs a global sequencer to
makes sure all nodes see writes in the same sequence
 Also the operations are full writes
 Together there is a significant communication
overhead
 Write invalidate does not need all that, just a
invalidation signal
 Write invalidate is thus more often used method
CS 704D Advanced OS 38
Data Locating in RMB Strategy
 Owner of a block needs to be located, the most recent
node which had write access
 Node that has a valid copy will need to be tracked
 Use on of the following
 Broadcasting
 Centralized server algorithm
 Fixed distributed server algorithm
 Dynamic distributed server algorithm
CS 704D Advanced OS 39
RNMB
 Replicas are maintained but blocks do not migrate
 Consistency is maintained by updating all the replicas
by a write update like process
CS 704D Advanced OS 40
Data Locating in RNMB Strategy
 Replica locations do not change
 Replicas are kept consistent
 Read requests can go to the nodes that has the data
block
 Writes through global sequencer
CS 704D Advanced OS 41
Munin: A Release Consistent DSM
System
 Structure: a collection of shared variables
 Each shared variable goes to a separate memory page
 acquireLock and releaselock are used
 Different consistency protocol is applied for different
types of shared variable used in the system
 Read-only, migratory, write-shared, producer-consumer,
result, reduction and conventional
CS 704D Advanced OS 42
Replacement Strategy
CS 704D Advanced OS 43
Replacement Strategy
 Shared memory blocks are replicated and/or migrated
so two strategies need to be decided
 Block to be replaced
 Where should the replaced block go
CS 704D Advanced OS 44
Blocks to Replace
 Usage based vs. non-usage based
 Fixed space vs. variable space
 Unused
 Nil
 Read only
 Read-owned
 Writable
CS 704D Advanced OS 45
Place for Replacement Block
 Using secondary store locally
 Using memory space of other nodes- store at free
memory space in some other node. Free memory space
status need to be exchanged, piggybacking on normal
communication messages
CS 704D Advanced OS 46
Thrashing
CS 704D Advanced OS 47
Thrashing Situations
 DSM allows migration, so migration back and forth leads
to thrashing
 Bata blocks keep migrating between nodes due to interleaved
accesses by processes
 Read only blocks are repeatedly invalidated so after
replication
CS 704D Advanced OS 48
Thrashing Reduction Strategies
 Application controlled locks
 Locking an application to a node for a time, deciding t
could be a very difficult issue
 Tune coherence strategy to the usage pattern,
transparency of the memory system is compromised
CS 704D Advanced OS 49
Other Approaches to DSM
CS 704D Advanced OS 50
Approaches
 Data caching managed by the OS
 Data Caching managed by MMUs
 Data Caching managed by the language run time
system
CS 704D Advanced OS 51
Heterogeneous DSM
CS 704D Advanced OS 52
Features of Heterogeneous DSM
 Data Conversion
 Structuring DSM as a source of source language objects
 Allowing one type of data in a block only (has
complications)
 Memory fragmentation
 Compilation issues
 Entire page is converted but a small part may be used before
transfer
 Not transparent, user provided conversion may be required
CS 704D Advanced OS 53
Advantages of DSM
CS 704D Advanced OS 54
Advantages
 Simpler abstraction
 Better portability of distributed applications
 Better performance of some Systems
 Flexible communications environment
 Ease of process migration
CS 704D Advanced OS 55

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

unix interprocess communication
unix interprocess communicationunix interprocess communication
unix interprocess communication
 
Threads
ThreadsThreads
Threads
 
Implementation of Pipe in Linux
Implementation of Pipe in LinuxImplementation of Pipe in Linux
Implementation of Pipe in Linux
 
Message queues
Message queuesMessage queues
Message queues
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
Ipc ppt
Ipc pptIpc ppt
Ipc ppt
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Pipes in Windows and Linux.
Pipes in Windows and Linux.Pipes in Windows and Linux.
Pipes in Windows and Linux.
 
System Calls
System CallsSystem Calls
System Calls
 
Processes
ProcessesProcesses
Processes
 
Implementation of FIFO in Linux
Implementation of FIFO in LinuxImplementation of FIFO in Linux
Implementation of FIFO in Linux
 
Unit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - ThreadsUnit II - 2 - Operating System - Threads
Unit II - 2 - Operating System - Threads
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Unix system calls
Unix system callsUnix system calls
Unix system calls
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
 
Unit 7
Unit 7Unit 7
Unit 7
 
Linux syllabus
Linux syllabusLinux syllabus
Linux syllabus
 
Part 04 Creating a System Call in Linux
Part 04 Creating a System Call in LinuxPart 04 Creating a System Call in Linux
Part 04 Creating a System Call in Linux
 

Destaque

multi processors
multi processorsmulti processors
multi processorsAcad
 
Cgmm presentation on distributed multimedia systems
Cgmm presentation on distributed multimedia systemsCgmm presentation on distributed multimedia systems
Cgmm presentation on distributed multimedia systemsMansi Verma
 
Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)Gaurav Dalvi
 
4.file service architecture
4.file service architecture4.file service architecture
4.file service architectureAbDul ThaYyal
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architectureMaulik Togadiya
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rulesOleg Tsal-Tsalko
 
Chapter 8 distributed file systems
Chapter 8 distributed file systemsChapter 8 distributed file systems
Chapter 8 distributed file systemsAbDul ThaYyal
 
Distributed shared memory shyam soni
Distributed shared memory shyam soniDistributed shared memory shyam soni
Distributed shared memory shyam soniShyam Soni
 
3. distributed file system requirements
3. distributed file system requirements3. distributed file system requirements
3. distributed file system requirementsAbDul ThaYyal
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
 

Destaque (13)

Ranjitbanshpal
RanjitbanshpalRanjitbanshpal
Ranjitbanshpal
 
multi processors
multi processorsmulti processors
multi processors
 
Cgmm presentation on distributed multimedia systems
Cgmm presentation on distributed multimedia systemsCgmm presentation on distributed multimedia systems
Cgmm presentation on distributed multimedia systems
 
Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)Multiprocessors(performance and synchronization issues)
Multiprocessors(performance and synchronization issues)
 
4.file service architecture
4.file service architecture4.file service architecture
4.file service architecture
 
Distributed shred memory architecture
Distributed shred memory architectureDistributed shred memory architecture
Distributed shred memory architecture
 
Distributed systems and scalability rules
Distributed systems and scalability rulesDistributed systems and scalability rules
Distributed systems and scalability rules
 
Distributed Systems Naming
Distributed Systems NamingDistributed Systems Naming
Distributed Systems Naming
 
Chapter 8 distributed file systems
Chapter 8 distributed file systemsChapter 8 distributed file systems
Chapter 8 distributed file systems
 
Distributed shared memory shyam soni
Distributed shared memory shyam soniDistributed shared memory shyam soni
Distributed shared memory shyam soni
 
3. distributed file system requirements
3. distributed file system requirements3. distributed file system requirements
3. distributed file system requirements
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
 

Semelhante a Cs704 d distributedmutualexcclusion&memory

Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYDistributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYreginamutio48
 
Cs704 d distributedschedulingetc.
Cs704 d distributedschedulingetc.Cs704 d distributedschedulingetc.
Cs704 d distributedschedulingetc.Debasis Das
 
Cs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1fundaCs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1fundaDebasis Das
 
Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.pptsirajmohammed35
 
Communication in Distributed System.ppt
Communication in Distributed System.pptCommunication in Distributed System.ppt
Communication in Distributed System.pptSELVAVINAYAGAMG
 
HbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyHbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyRohit Dubey
 
Beyond Off the-Shelf Consensus
Beyond Off the-Shelf ConsensusBeyond Off the-Shelf Consensus
Beyond Off the-Shelf ConsensusRebecca Bilbro
 
Chapter 4 communication2
Chapter 4 communication2Chapter 4 communication2
Chapter 4 communication2DBU
 
MC0085 – Advanced Operating Systems - Master of Computer Science - MCA - SMU DE
MC0085 – Advanced Operating Systems - Master of Computer Science - MCA - SMU DEMC0085 – Advanced Operating Systems - Master of Computer Science - MCA - SMU DE
MC0085 – Advanced Operating Systems - Master of Computer Science - MCA - SMU DEAravind NC
 
Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfsamaghorab
 
2.communcation in distributed system
2.communcation in distributed system2.communcation in distributed system
2.communcation in distributed systemGd Goenka University
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationMani Deepak Choudhry
 

Semelhante a Cs704 d distributedmutualexcclusion&memory (20)

Csc concepts
Csc conceptsCsc concepts
Csc concepts
 
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYDistributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Ds ppt imp.
Ds ppt imp.Ds ppt imp.
Ds ppt imp.
 
Cloud C
Cloud CCloud C
Cloud C
 
Cs704 d distributedschedulingetc.
Cs704 d distributedschedulingetc.Cs704 d distributedschedulingetc.
Cs704 d distributedschedulingetc.
 
Cs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1fundaCs 704 d set4distributedcomputing-1funda
Cs 704 d set4distributedcomputing-1funda
 
Chapter 2B-Communication.ppt
Chapter 2B-Communication.pptChapter 2B-Communication.ppt
Chapter 2B-Communication.ppt
 
Communication in Distributed System.ppt
Communication in Distributed System.pptCommunication in Distributed System.ppt
Communication in Distributed System.ppt
 
HbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubeyHbaseHivePigbyRohitDubey
HbaseHivePigbyRohitDubey
 
Distributed Computing
Distributed ComputingDistributed Computing
Distributed Computing
 
Beyond Off the-Shelf Consensus
Beyond Off the-Shelf ConsensusBeyond Off the-Shelf Consensus
Beyond Off the-Shelf Consensus
 
Par com
Par comPar com
Par com
 
Fundamentals
FundamentalsFundamentals
Fundamentals
 
Chapter 4 communication2
Chapter 4 communication2Chapter 4 communication2
Chapter 4 communication2
 
MC0085 – Advanced Operating Systems - Master of Computer Science - MCA - SMU DE
MC0085 – Advanced Operating Systems - Master of Computer Science - MCA - SMU DEMC0085 – Advanced Operating Systems - Master of Computer Science - MCA - SMU DE
MC0085 – Advanced Operating Systems - Master of Computer Science - MCA - SMU DE
 
Lec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdfLec+3-Introduction-to-Distributed-Systems.pdf
Lec+3-Introduction-to-Distributed-Systems.pdf
 
Chapter 3-Processes.ppt
Chapter 3-Processes.pptChapter 3-Processes.ppt
Chapter 3-Processes.ppt
 
2.communcation in distributed system
2.communcation in distributed system2.communcation in distributed system
2.communcation in distributed system
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
 

Mais de Debasis Das

Developing robust &amp; enterprise io t applications
Developing robust &amp; enterprise io t applicationsDeveloping robust &amp; enterprise io t applications
Developing robust &amp; enterprise io t applicationsDebasis Das
 
IoT: An Introduction and Getting Started Session
IoT: An Introduction and Getting Started SessionIoT: An Introduction and Getting Started Session
IoT: An Introduction and Getting Started SessionDebasis Das
 
Development eco-system in free-source for io t
Development eco-system in free-source for io tDevelopment eco-system in free-source for io t
Development eco-system in free-source for io tDebasis Das
 
Microprocessors & microcontrollers- The design Context
Microprocessors & microcontrollers- The design ContextMicroprocessors & microcontrollers- The design Context
Microprocessors & microcontrollers- The design ContextDebasis Das
 
Management control systems jsb 606 part4
Management control systems jsb 606 part4Management control systems jsb 606 part4
Management control systems jsb 606 part4Debasis Das
 
Management control systems jsb 606 part3
Management control systems jsb 606 part3Management control systems jsb 606 part3
Management control systems jsb 606 part3Debasis Das
 
Management control systems jsb 606 part2
Management control systems jsb 606 part2Management control systems jsb 606 part2
Management control systems jsb 606 part2Debasis Das
 
Management control systems jsb 606 part1
Management control systems jsb 606 part1Management control systems jsb 606 part1
Management control systems jsb 606 part1Debasis Das
 
Computers for management jsb 1072003 ver
Computers for management jsb 1072003 verComputers for management jsb 1072003 ver
Computers for management jsb 1072003 verDebasis Das
 
Trends in education management
Trends in education managementTrends in education management
Trends in education managementDebasis Das
 
Ei502microprocessorsmicrtocontrollerspart4 8051 Microcontroller
Ei502microprocessorsmicrtocontrollerspart4 8051 MicrocontrollerEi502microprocessorsmicrtocontrollerspart4 8051 Microcontroller
Ei502microprocessorsmicrtocontrollerspart4 8051 MicrocontrollerDebasis Das
 
Ei502microprocessorsmicrtocontrollerspart5 sixteen bit8086 1
Ei502microprocessorsmicrtocontrollerspart5 sixteen bit8086 1Ei502microprocessorsmicrtocontrollerspart5 sixteen bit8086 1
Ei502microprocessorsmicrtocontrollerspart5 sixteen bit8086 1Debasis Das
 
Ei502 microprocessors & micrtocontrollers part3hardwareinterfacing
Ei502 microprocessors & micrtocontrollers part3hardwareinterfacingEi502 microprocessors & micrtocontrollers part3hardwareinterfacing
Ei502 microprocessors & micrtocontrollers part3hardwareinterfacingDebasis Das
 
Ei502 microprocessors & micrtocontrollers part 2(instructionset)
Ei502 microprocessors & micrtocontrollers part 2(instructionset)Ei502 microprocessors & micrtocontrollers part 2(instructionset)
Ei502 microprocessors & micrtocontrollers part 2(instructionset)Debasis Das
 
Ei502 microprocessors & micrtocontrollers part 1
Ei502 microprocessors & micrtocontrollers part 1Ei502 microprocessors & micrtocontrollers part 1
Ei502 microprocessors & micrtocontrollers part 1Debasis Das
 
It802 d mobilecommunicationspart4
It802 d mobilecommunicationspart4It802 d mobilecommunicationspart4
It802 d mobilecommunicationspart4Debasis Das
 
It802 d mobilecommunicationspart3
It802 d mobilecommunicationspart3It802 d mobilecommunicationspart3
It802 d mobilecommunicationspart3Debasis Das
 
It 802 d_Mobile Communications_part 2
It 802 d_Mobile Communications_part 2It 802 d_Mobile Communications_part 2
It 802 d_Mobile Communications_part 2Debasis Das
 
It 802 d_Mobile Communications_part 2
It 802 d_Mobile Communications_part 2It 802 d_Mobile Communications_part 2
It 802 d_Mobile Communications_part 2Debasis Das
 
It 802 d_mobile_communicationsSomeHistory
It 802 d_mobile_communicationsSomeHistoryIt 802 d_mobile_communicationsSomeHistory
It 802 d_mobile_communicationsSomeHistoryDebasis Das
 

Mais de Debasis Das (20)

Developing robust &amp; enterprise io t applications
Developing robust &amp; enterprise io t applicationsDeveloping robust &amp; enterprise io t applications
Developing robust &amp; enterprise io t applications
 
IoT: An Introduction and Getting Started Session
IoT: An Introduction and Getting Started SessionIoT: An Introduction and Getting Started Session
IoT: An Introduction and Getting Started Session
 
Development eco-system in free-source for io t
Development eco-system in free-source for io tDevelopment eco-system in free-source for io t
Development eco-system in free-source for io t
 
Microprocessors & microcontrollers- The design Context
Microprocessors & microcontrollers- The design ContextMicroprocessors & microcontrollers- The design Context
Microprocessors & microcontrollers- The design Context
 
Management control systems jsb 606 part4
Management control systems jsb 606 part4Management control systems jsb 606 part4
Management control systems jsb 606 part4
 
Management control systems jsb 606 part3
Management control systems jsb 606 part3Management control systems jsb 606 part3
Management control systems jsb 606 part3
 
Management control systems jsb 606 part2
Management control systems jsb 606 part2Management control systems jsb 606 part2
Management control systems jsb 606 part2
 
Management control systems jsb 606 part1
Management control systems jsb 606 part1Management control systems jsb 606 part1
Management control systems jsb 606 part1
 
Computers for management jsb 1072003 ver
Computers for management jsb 1072003 verComputers for management jsb 1072003 ver
Computers for management jsb 1072003 ver
 
Trends in education management
Trends in education managementTrends in education management
Trends in education management
 
Ei502microprocessorsmicrtocontrollerspart4 8051 Microcontroller
Ei502microprocessorsmicrtocontrollerspart4 8051 MicrocontrollerEi502microprocessorsmicrtocontrollerspart4 8051 Microcontroller
Ei502microprocessorsmicrtocontrollerspart4 8051 Microcontroller
 
Ei502microprocessorsmicrtocontrollerspart5 sixteen bit8086 1
Ei502microprocessorsmicrtocontrollerspart5 sixteen bit8086 1Ei502microprocessorsmicrtocontrollerspart5 sixteen bit8086 1
Ei502microprocessorsmicrtocontrollerspart5 sixteen bit8086 1
 
Ei502 microprocessors & micrtocontrollers part3hardwareinterfacing
Ei502 microprocessors & micrtocontrollers part3hardwareinterfacingEi502 microprocessors & micrtocontrollers part3hardwareinterfacing
Ei502 microprocessors & micrtocontrollers part3hardwareinterfacing
 
Ei502 microprocessors & micrtocontrollers part 2(instructionset)
Ei502 microprocessors & micrtocontrollers part 2(instructionset)Ei502 microprocessors & micrtocontrollers part 2(instructionset)
Ei502 microprocessors & micrtocontrollers part 2(instructionset)
 
Ei502 microprocessors & micrtocontrollers part 1
Ei502 microprocessors & micrtocontrollers part 1Ei502 microprocessors & micrtocontrollers part 1
Ei502 microprocessors & micrtocontrollers part 1
 
It802 d mobilecommunicationspart4
It802 d mobilecommunicationspart4It802 d mobilecommunicationspart4
It802 d mobilecommunicationspart4
 
It802 d mobilecommunicationspart3
It802 d mobilecommunicationspart3It802 d mobilecommunicationspart3
It802 d mobilecommunicationspart3
 
It 802 d_Mobile Communications_part 2
It 802 d_Mobile Communications_part 2It 802 d_Mobile Communications_part 2
It 802 d_Mobile Communications_part 2
 
It 802 d_Mobile Communications_part 2
It 802 d_Mobile Communications_part 2It 802 d_Mobile Communications_part 2
It 802 d_Mobile Communications_part 2
 
It 802 d_mobile_communicationsSomeHistory
It 802 d_mobile_communicationsSomeHistoryIt 802 d_mobile_communicationsSomeHistory
It 802 d_mobile_communicationsSomeHistory
 

Último

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 

Cs704 d distributedmutualexcclusion&memory

  • 2. Mutual Exclusion CS 704D Advanced OS 2
  • 3. Complexities In distributed systems  Absence of shared memory  Inter-node communication delays can be considerable  Global system state cannot be observed by constituent machines due to communication delays, component failures, absence of shared memory  Many more modes of failures yet fail soft is a goal CS 704D Advanced OS 3
  • 4. Some Considerations  Policies/strategies developed for a distributed system can be made applicable in a uniprocessor case  However, policies/strategies developed for uniprocessor case cannot be extended to distributed case  Same can be simulated by adding a central resources allocator  Increase traffic to central allocator, the system will fail when the allocator fails  Election of a successor would be needed CS 704D Advanced OS 4
  • 5. Required Assumptions  Messages exchanged by a pair of communicating processes need to be received in the same order as they were generated (pipelining property)  Every message is received without errors, no duplicates  The underlying network ensures all nodes are fully connected. Any node can communicate with every other node CS 704D Advanced OS 5
  • 6. Desirable Properties of Algorithms  All nodes should have equal amount of information  Each node makes decisions on the basis of local information. The algorithm should ensure that nodes make consistent & coherent decisions  All nodes reach decisions through about equal effort  Failure of a node should not cause complete break down. The ability of reaching a decision and accessing the resources should not be affected CS 704D Advanced OS 6
  • 7. Time & Ordering of Events Happened Before Relationship  Logical clock needs to ensure  If a and b are events in the same process and a comes before b then a->b  If event a is a representation of sending of a message and b is that of receiving of message in another process the a->b  It is a transitive relationship; that is if a->b and b->c then a->c  If a and b has no happened before relationship the a and b are said to be concurrent CS 704D Advanced OS 7
  • 8. Time & Ordering of Events Logical Clock Properties  If a->b the C(a) < C(b)  Clock condition is satisfied if  If a and b are events in a process Pi and if a comes before b the Ci(a)< Ci(b)  If a is an event sending message m by process Pi and b is the receipt of message by process Pj then Ci(a) <Cj(b) CS 704D Advanced OS 8
  • 9. Time & Ordering of Events Logical Clock Implementation  Process Pi increments the clock Ci between successive events  Message m needs to be time stamped so that T(m)=ci(a)  Receiving process adjusts clock such that it is max of (Cj+1, Tm) CS 704D Advanced OS 9
  • 10. Total Ordering  ab only when  Ci(a) “less than” Cj(b) or  Ci(a) = Cj(b) and Pi “less than” Pj  Simple way to implement “less than” relation would be to assign a unique number to each process and define the “less than” such that i < j. CS 704D Advanced OS 10
  • 11. Lamport’s Algorithm  Initiator i: Process Pi requires an exclusive access to a resource. Sends time stamped message request (Ti, i) where Ti = Ci to all the other processes.  Other processes(j, j not= i): When Pj receives the request, places the request on its own queue, send a reply with time stamp (Tj, j) to Process Pi  Pi is allowed access only when  Pi request is in front of the queue and  All replies are time stamped later that the Pi time stamp  Pi sends a release message by sending a release message, time stamped suitably  Pj removes Pi request from it request queue Cost: 3 (N-1) messages, works best on bus based system where broadcast costs are minimal CS 704D Advanced OS 11
  • 12. Ricart-Agarwala Algorithm  Initiator i: Process Pi requires an exclusive access to a resource. Sends time stamped message request (Ti, i) where Ti = Ci to all the other processes.  Other processes(j, j not= i): When Pj receives the request reacts as follows,  If Pj is not requesting the resource, it sends a time stamped reply  If Pj needs the resource and the time stamp precedes the Pi’s time stamp Pi’s request is retained, else a time stamped reply is returned.  Pi is allowed access only when  Pi request is in front of the queue and  All replies are time stamped later that the Pi time stamp  Pi sends a releases resource by sending a release message, for each pending resources Cost: 2(N-1) messages CS 704D Advanced OS 12
  • 13. Distributed Shared Memory  A software abstraction over the loosely coupled systems  Provides a shared memory kind of operation over the underlying IPC/RPC mechanisms  Can be implemented in OS kernel or runtime system  Also known as Distributed Shared Virtual Memory System (DSVM)  The shared space exists only virtually CS 704D Advanced OS 13
  • 14. DSM Architecture CS 704D Advanced OS 14 Distributed Shared Memory Layer Memory Mapping CPU(s) Memory Mapping CPU(s) Memory Mapping CPU(s) Communication Network
  • 15. DSM Architecture  Unlike tightly coupled systems, this shared memory is entirely virtual  Partitioned into blocks  Local memory is treated as large local caches  If the data requested is not available locally a network fault is generated  OS, through a message, requests the node holding the block and gets it migrated to the node where fault occurred  Data may be replicated locally  Configuration varies depending on what kind of replication, migration policies are used CS 704D Advanced OS 15
  • 16. Design issues  Granularity (block size): Smaller size, higher faults, traffic; larger blocks mean jobs with higher locality  Structure: Layout of data, depends on application  Coherence & access synchronization: Like the cache situation in a uniprocessor system  Data Location & access: what data to be replicated, located  Replacement strategy  Thrashing  Heterogeneity CS 704D Advanced OS 16
  • 18. Block Size Selection Factors  Large block sizes favored as overheads to transfer smaller blocks and larger one not too different  Paging overhead- paging overheads also favors larger block sizes, application should thus have larger locality of reference  Directory size-smaller block larger directory, larger management overhead  Thrashing- thrashing is likely to increase with larger block size  False sharing-larger block sizes increases probability. Consequence, higher thrashing CS 704D Advanced OS 18
  • 19. Page Size as Block Size  Page size is preferred as the DSM block size  Advantages are  Existing page fault hardware can be used as block fault mechanism. Memory coherence can be handled in page fault handlers  Access control can be managed with existing memory mapping systems  If page size is less than packet size, no extra overhead  Page size proved to be, over time, the right unit as far as memory contention CS 704D Advanced OS 19
  • 21. Structure of Shared Memory Space  Approaches to structuring  No structure: a linear array of memory, easy to design  By data type: granularity per variable, complex to handle  As database: as tuple space, associative memory, primitives need to be added to languages, non transparent access to shared data CS 704D Advanced OS 21
  • 22. Consistency Models CS 704D Advanced OS 22
  • 23. Consistency Models  Strict consistency  Sequential consistency  Causal consistency  Pipelined random access memory consistency  Processor consistency  Weak consistency  Release consistency CS 704D Advanced OS 23
  • 24. Strict Consistency Model  Value read of a memory address is the same as the latest write at that address  Writes become visible to all nodes  Needs absolute ordering of memory read/write operations, a global time required (to define most recent)  Nearly impossible to implement CS 704D Advanced OS 24
  • 25. Sequential Consistency Model  All processes should see the same ordering of read, writes  Exact interleaving does not matter  No memory operation is started unless earlier operations have completed  Acceptable in most applications CS 704D Advanced OS 25
  • 26. Causal Consistency Model  Operations are seen in same order (correct order)when they are causally related  W2 follows w1 and causally related, then w1, w2 is the order every process should see  They may not be seen in same order when not related causally CS 704D Advanced OS 26
  • 27. Pipelined RAM Consistency Model  All writes of a single process are seen in the same order by other processes (as in a pipeline)  However, writes by other processes may appear in different order.  (W11,w12) and (w21, w22) can be seen as (wi1,wi2) followed by (w21, w22) or (w21, w22) followed by (w11,w12)  Simple to implement CS 704D Advanced OS 27
  • 28. Processor Consistency Model  Adds memory coherence to the PRAM model  That is if the writes are for a particular memory location then all processes should see the writes in the same order that maintains memory coherence CS 704D Advanced OS 28
  • 29. Weak Consistency Model  Changes in memory can be made after a set of changes has happened (example critical section)  Isolated access to variable is usually rare, usually there will be several accesses and then none at all  Difficulty is the system would not know when to show the changes  Application programmers can take care of this through a synchronization variable  Necessarily  All accesses to sync variable must follow strongest consistency9sequential)  All pending writes must be completed before access to sync variable is allowed  All previous access to sync must be completed before another access is allowed CS 704D Advanced OS 29
  • 30. Release Consistency Model  Weak consistency model requires that  All changes made by a process are propagated to all nodes  All changes at other nodes are propagated to the processor node  Acquire and release variable used for sync so that only one of the operations above need to be done CS 704D Advanced OS 30
  • 31. Discussion of Models  Strict sequential model s difficult to implement, almost never implemented  Sequential consistency model is most commonly used  Causal, PRAM, processor, weak and release consistency are the ones implemented in many DSM systems, programmers need to intervene  Weak and release consistency provides explicit sync variables to help with the consistency CS 704D Advanced OS 31
  • 32. Implementing Sequential Concurrency Model  Implementing sequential consistency would depend on what replication/ migration are allowed  Migration/Replication strategies  Non replicated, non migrating blocks (NRNMBs)  Non replicated, migrating blocks (NRMBs)  Replicated, migrating blocks (RMBs)  Replicated, non migrating blocks (RNMBs) CS 704D Advanced OS 32
  • 33. NRNMB  All requests to a block are routed through the OS and MMU to this one block that is not replicate and does not move anywhere  Can cause  Bottleneck because of serializing of memory accesses  Parallelism is not possible CS 704D Advanced OS 33
  • 34. NRMB  No copies, if required entire block may be moved to the node that requires it  Advantages  No communication costs, all accesses are local  Applications can take advantage of locality, applications with high locality will perform better  Disadvantages  Prone to thrashing  No advantage of parallelism CS 704D Advanced OS 34
  • 35. Data Locating in NRMB  Broadcast  Fault happens, a request is broadcast, current owner sends the block  Broadcast cause communication overheads  Centralized server  Request sent to the server, servers asks the node holding the block to send it to the requesting node, updates location information  Fixed distributed server  Fault handler finds mapping of block to the specific server, send request and gets the block  Dynamic distributed server  Fault causes a local search for probable owner, goes to that node, finds another probable owner or the block, gets block updates info CS 704D Advanced OS 35
  • 36. RMB  Replication is required to increase parallelism  Reads can be done locally, writes has overheads  High read/write ratio systems can apportion the write overhead over many reads  Maintaining coherence throughout replicated block is an issue  Two basic protocols used are  Write-invalidate  Write update CS 704D Advanced OS 36
  • 37. Coherence Protocols  Write-invalidate  On write fault, the fault handler copies the block from one of the nodes to its own  Invalidates all the copies, writes data  If another node needs it now, the updated block is replicated  Write update  On write fault, copy block to local node, update data  Send address & new data to all the replicas  Operation resumes after all the writes are done CS 704D Advanced OS 37
  • 38. Comparison  Write update typically needs a global sequencer to makes sure all nodes see writes in the same sequence  Also the operations are full writes  Together there is a significant communication overhead  Write invalidate does not need all that, just a invalidation signal  Write invalidate is thus more often used method CS 704D Advanced OS 38
  • 39. Data Locating in RMB Strategy  Owner of a block needs to be located, the most recent node which had write access  Node that has a valid copy will need to be tracked  Use on of the following  Broadcasting  Centralized server algorithm  Fixed distributed server algorithm  Dynamic distributed server algorithm CS 704D Advanced OS 39
  • 40. RNMB  Replicas are maintained but blocks do not migrate  Consistency is maintained by updating all the replicas by a write update like process CS 704D Advanced OS 40
  • 41. Data Locating in RNMB Strategy  Replica locations do not change  Replicas are kept consistent  Read requests can go to the nodes that has the data block  Writes through global sequencer CS 704D Advanced OS 41
  • 42. Munin: A Release Consistent DSM System  Structure: a collection of shared variables  Each shared variable goes to a separate memory page  acquireLock and releaselock are used  Different consistency protocol is applied for different types of shared variable used in the system  Read-only, migratory, write-shared, producer-consumer, result, reduction and conventional CS 704D Advanced OS 42
  • 44. Replacement Strategy  Shared memory blocks are replicated and/or migrated so two strategies need to be decided  Block to be replaced  Where should the replaced block go CS 704D Advanced OS 44
  • 45. Blocks to Replace  Usage based vs. non-usage based  Fixed space vs. variable space  Unused  Nil  Read only  Read-owned  Writable CS 704D Advanced OS 45
  • 46. Place for Replacement Block  Using secondary store locally  Using memory space of other nodes- store at free memory space in some other node. Free memory space status need to be exchanged, piggybacking on normal communication messages CS 704D Advanced OS 46
  • 48. Thrashing Situations  DSM allows migration, so migration back and forth leads to thrashing  Bata blocks keep migrating between nodes due to interleaved accesses by processes  Read only blocks are repeatedly invalidated so after replication CS 704D Advanced OS 48
  • 49. Thrashing Reduction Strategies  Application controlled locks  Locking an application to a node for a time, deciding t could be a very difficult issue  Tune coherence strategy to the usage pattern, transparency of the memory system is compromised CS 704D Advanced OS 49
  • 50. Other Approaches to DSM CS 704D Advanced OS 50
  • 51. Approaches  Data caching managed by the OS  Data Caching managed by MMUs  Data Caching managed by the language run time system CS 704D Advanced OS 51
  • 52. Heterogeneous DSM CS 704D Advanced OS 52
  • 53. Features of Heterogeneous DSM  Data Conversion  Structuring DSM as a source of source language objects  Allowing one type of data in a block only (has complications)  Memory fragmentation  Compilation issues  Entire page is converted but a small part may be used before transfer  Not transparent, user provided conversion may be required CS 704D Advanced OS 53
  • 54. Advantages of DSM CS 704D Advanced OS 54
  • 55. Advantages  Simpler abstraction  Better portability of distributed applications  Better performance of some Systems  Flexible communications environment  Ease of process migration CS 704D Advanced OS 55