Upload
liseli
View
26
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Reactive Synchronization Algorithms for Multiprocessors. Beng-Hong Lim and Anant Agarwal Laboratory of Computer Science Massachusetts Institute of Technology. Zahid Irfan Department of Computer Science Lahore University of Management Sciences 1 st February 2003. Introduction. - PowerPoint PPT Presentation
Citation preview
Reactive Synchronization Reactive Synchronization Algorithms for Algorithms for
MultiprocessorsMultiprocessorsBeng-Hong Lim and Anant AgarwalBeng-Hong Lim and Anant Agarwal
Laboratory of Computer ScienceLaboratory of Computer ScienceMassachusetts Institute of TechnologyMassachusetts Institute of Technology
Zahid IrfanZahid IrfanDepartment of Computer ScienceDepartment of Computer Science
Lahore University of Management SciencesLahore University of Management Sciences11stst February 2003 February 2003
IntroductionIntroduction
Multiprocessors Multiprocessors Alewife – Shared memory Multiprocessor Alewife – Shared memory Multiprocessor
SynchronizationSynchronization Shared Memory ProtocolsShared Memory Protocols Message Passing ProtocolsMessage Passing Protocols
Reactive Synchronization AlgorithmsReactive Synchronization Algorithms Dynamically select the protocolDynamically select the protocol
Synchronizations Algorithms Synchronizations Algorithms
Passive Spin-Lock Passive Spin-Lock AlgorithmsAlgorithms Test & Set with Test & Set with
Exponential BackoffExponential Backoff Queue LocksQueue Locks
… … Synchronization AlgorithmsSynchronization Algorithms
Passive Fetch & Op AlgorithmPassive Fetch & Op Algorithm Lock-based Fetch & OpLock-based Fetch & Op Software Combining TreeSoftware Combining Tree
ProblemsProblems
Variation in performance at different Variation in performance at different contention levels…contention levels… Spin Locks Spin Locks
Low Contention Low Contention Test & Set with Exponential Back offTest & Set with Exponential Back off
High ContentionHigh Contention MCS Queue Lock MCS Queue Lock
… … ProblemsProblems
Variation in performance at different Variation in performance at different contention levels…contention levels… Fetch and OpFetch and Op
Low Contention Low Contention Test & Test & Set LockTest & Test & Set Lock
High ContentionHigh Contention Software Combining TreeSoftware Combining Tree
Need.. Justifies .. SolutionNeed.. Justifies .. Solution
Solution for synchronizationSolution for synchronization Select Protocol Dynamically… Select Protocol Dynamically…
- How to detect?How to detect?
- How to change the protocol?How to change the protocol?
- When to switch the protocol?When to switch the protocol?
Reactive synchronization AlgorithmReactive synchronization Algorithm
Synchronization AlgorithmSynchronization Algorithm Protocol Selection AlgorithmProtocol Selection Algorithm
Selects the appropriate protocolSelects the appropriate protocol
Waiting AlgorithmWaiting Algorithm Selects the mechanism to wait for synchronizationSelects the mechanism to wait for synchronization
Algorithm BuildingAlgorithm Building
Main Difficulty lies in Multiple ProcessesMain Difficulty lies in Multiple Processes Processes with “correct” protocol should be Processes with “correct” protocol should be
preferredpreferred
Assumption : Contention levels are “fairly” Assumption : Contention levels are “fairly” constantconstant
Contention time is highly architecture Contention time is highly architecture dependentdependent Switching policy will be Architecture optimizedSwitching policy will be Architecture optimized
Reactive Spin LockReactive Spin Lock
A combination of A combination of Test-Test-Set Lock + Test-Test-Set Lock + MCS Queue LockMCS Queue Lock Mode Variable Mode Variable
determines which determines which protocol to use.protocol to use.
Protocol Detection Protocol Detection SchemeScheme Cached-mode variable Cached-mode variable
which provides hints of which provides hints of level of contentionlevel of contention
Reactive Spin LockReactive Spin Lock
Protocol ChangeProtocol Change Lock holders can update the mode variable Lock holders can update the mode variable
i.e., effectively change protocolsi.e., effectively change protocols
When to change When to change Level of lock contention crosses a threshold Level of lock contention crosses a threshold
switch to the Queue Lockswitch to the Queue Lock The queue is empty switch to the TTS LockThe queue is empty switch to the TTS Lock
Reactive Spin Lock Reactive Spin Lock
Consensus ObjectConsensus Object Unique for each protocol (valid or invalid) Unique for each protocol (valid or invalid)
ensures single protocol.ensures single protocol. Complete the execution of the protocol.Complete the execution of the protocol. State is modified only by the process having State is modified only by the process having
consensus object.consensus object.
Reactive Fetch & OpReactive Fetch & Op
Mode variable selecting betweenMode variable selecting between Test-Test-Set and LockTest-Test-Set and Lock Queue LockQueue Lock Software Combining TreeSoftware Combining Tree
Only one consensus object is validOnly one consensus object is valid Process with consensus object is allowed Process with consensus object is allowed
to change the protocol.to change the protocol.
Reactive Fetch & OpReactive Fetch & Op
Queue gives a good estimate of Queue gives a good estimate of contention level if high switch to contention level if high switch to Combining Tree.Combining Tree.
If number the number of successive Fetch If number the number of successive Fetch & Op reach the root without combining & Op reach the root without combining switch to TTS-Lock.switch to TTS-Lock.
Message Passing ProtocolsMessage Passing Protocols
Most Shared Memory Most Shared Memory on top of Message on top of Message Passing MachinesPassing Machines Use Message Passing Use Message Passing
Combining Tree Combining Tree Message Passing Message Passing
Queue Lock Queue Lock
Applications TestedApplications Tested
GamtebGamteb Traveling Sales Man ProblemTraveling Sales Man Problem Adaptive Quadrature (AQ)Adaptive Quadrature (AQ) MP3DMP3D CholeskyCholesky
PerformancePerformance
Spin Lock AlgorithmsSpin Lock Algorithms
PerformancePerformance
Fetch “&” Op AlgorithmsFetch “&” Op Algorithms
PerformancePerformance
Variations in Variations in ContentionContention
PerformancePerformance
Variations in Variations in ContentionContention
ConclusionsConclusions
Proved that managing different protocols Proved that managing different protocols is not prohibitiveis not prohibitive
Efficient Selection of protocols through Efficient Selection of protocols through consensus objectconsensus object
Performance modest for Spin Locks and Performance modest for Spin Locks and significant for Fetch & Opsignificant for Fetch & Op
For source listings: ftp://hing.lcs.mit.eduFor source listings: ftp://hing.lcs.mit.edu