1Johannes SchneiderTransactional Memory: How to Per as long as m Load Adaption in a Simpl

1Johannes SchneiderTransactional Memory: How to Per as long as m Load Adaption in a Simpl www.phwiki.com

1Johannes SchneiderTransactional Memory: How to Per as long as m Load Adaption in a Simpl

Wallace, Bob, Executive Editor has reference to this Academic Journal, PHwiki organized this Journal 1Johannes SchneiderTransactional Memory: How to Per as long as m Load Adaption in a Simple And Distributed MannerJohannes SchneiderDavid HasenfratzRoger Wattenhofer2Johannes Schneider“computer science will become washing machine science.“ Without easy in addition to efficient parallel programming methods How to h in addition to le access to shared dataLocks, Monitors Coarse grained vs. fine grained locking easy but slow program dem in addition to ing, time consuming but fast programs Problemsdifficulterror proneComposability Johannes Schneider lock all data modify/use data unlock all data lock A lock B modify/use A,B lock C modify/use A,B,C unlock A modify/use B,C unlock B,Clock Block Amodify/use A,Bunlock A,BDeadlock!Only 1 thread can execute3Thread 1 Thread 2

Zaporizhzhe National Technical University UA www.phwiki.com

This Particular University is Related to this Particular Journal

Transactional memory(TM) – a possible solutionSimple as long as the programmerComposable Idea from database communityMany TM systems (internally) still use locksBut the TM system (not the programmer) takes care ofPer as long as manceCorrectness (no deadlocks )Johannes SchneiderBegin transactionmodify/use dataEnd transactionMethod A.x()Begin TransactionB.y() End TransactionMethod B.y() Begin transaction End transaction4Transactional memory systemsIf transactions modify different data, everything is ok the same data, conflicts arise that must be resolvedTransactions might get delayed or aborted Job of a contention managerA transaction keeps track of all modified valuesIt restores all values, if it is abortedA transaction successfully finishes with a commitJohannes Schneider5Abort or delay a transaction, i.e. adapt loadDistributedEach thread has its own managerExampleInitially: A=1, B=1Manager 1 Manager 2T1Trans. 1T1Trans. 2B:=2 A:=3 conflict A:=2 Abort (undo all changes, i.e. set A:=1) in addition to restart (after a while)T1Trans.1 A:=2 Trans. 2B:=2 A:=3 conflictAbort (set B:=1) in addition to restart OR wait in addition to retryConflicts – A contention manager decidesJohannes Schneider6Manager 1Manager 2Delay to adapt load!

Prior workContention Managers [PODC03,PODC05,ISAAC09 ]System load was not (explicitly) consideredLoad adaption (based on contention)Estimate contention intensity: CI [SPAA08]If abort: CI = a CI + (1-a) with parameter a [0,1] If commit: CI = a CI If CI > parameter b then resort to central schedulerKeep a transaction queue per core [PODC08]Central dispatcher assigns transactions to a core, i.e. its queue Each core iteratively executes transactions from queueIf transaction A on core 1 is aborted due to B on core 2 then A is appended to the queue of core 2Central scheduler will become a bottleneckJohannes Schneider7Core 1Core 2ABCDCore 1Core 2ABCDB aborts AThis paperTheoretical analysisDecentralized (simple) approaches to load adaption based on contentionJohannes Schneider8StrategiesIgnore: Do not learn from conflictsImmediateRestartStay real: Remember faced conflictsSerializeFacedConflictsDo not schedule prior conflicting transactions concurrentlyBe cautious: Assume additional conflictsSerializeAllAll transactions in a subgraph are assumed to conflictJohannes Schneider9BADCConflict graphA conflicted with CD conflicted with BADCBADCBACBD

Load Adaption StrategiesAbortBackoffIf aborted wait as long as a r in addition to om time [0,2 aborts]Priority = number of aborts abortsWho wins a conflict 2 strategiesEstimate the work doneUnrelated to work doneJohannes Schneider10Theory Part – Modeln transactions ( in addition to threads) Start concurrently on n coresTransaction sequence of operationsoperation takes 1 time unitduration (number of operations) tT is fixed 2 types of operationsWrite = modify (shared) resource in addition to lock it until commitCompute/abort/commitIgnore overhead of load adaptionRemembering transactions, scheduling Johannes Schneider11Core 1Core 2BACore nZ AModerate parallelismShared counter Conflicts directly after transaction startLinked List Conflicts at arbitrary timeExpected time span until all transactions committedSpeed-up log n (at best)Johannes Schneider12Transaction run time transactions

Substantial parallelismWorst caseConflict graph is d-ary tree of logarithmic heightExponential gap in worst case SerializeAll in addition to othersJohannes Schneider13T1T2T3T4T5 Practical investigationRemembering conflicts causes too much overheadGood as long as analysis but not as long as implementationQuickadapterSerializes transactionsEach core has a “waiting” flagIf aborted, set flag in addition to wait until flag unsetIf commit, unset some flagAbortBackOff(Also considered some variants)Johannes Schneider14Practical investigationEvaluation on 16 core machineDSTM2 systemVisible readersSix benchmarksLittle parallelismShared counter, Sorted List (accessed objects not released), ListcounterConsiderable parallelism Red Black Tree, LFUCache, R in addition to omAccessArrayCompare new load adaption policies to existing contention managersJohannes Schneider15

DiscussionHard to keep maximum throughput, also in [SPAA08, PODC08] Even without conflictsImprovement as long as 1 benchmark worsens anotherOn average better than schemes without load adaption16Johannes SchneiderConclusionSimple in addition to distributed load adaption strategiesTheory(For now) constants in addition to parameters matter a lotPracticeHard to keep load at peak as long as all usage patterns17Johannes Schneider18Johannes Schneidervspace{10pt}Thanks as long as your attention!Questions

Analysis AbortBackoff as long as counter Recall: If aborted wait as long as a r in addition to om time [0,2 aborts]Assume aborts ~ log (ntT) + x ( as long as some x) Define: a(x) := fraction of active nodes a(0) = 1 (after time ~2log (ntT) = ntT a constant fraction still active)Chance conflict as long as interval [0,2 aborts] Interval [0, 2log(ntT)+x ] ~ a(x) ntT / 2log (ntT) +x = a(x) /2xa(x+1) = a(x)/2x = 1/2i=0 x i ~ 1/2x2a(log n) = 1/2(log n)2 = 1/ni=0 log (ntT) +log n length interval = i=0 log (ntT) +log n 2i = ntT 2log n+1Johannes Schneider19T1T2T3 a(x)ntT = 3/n n tT = 3tT

Wallace, Bob XChange Executive Editor www.phwiki.com

Wallace, Bob Executive Editor

Wallace, Bob is from United States and they belong to XChange and they are from  Phoenix, United States got related to this Particular Journal. and Wallace, Bob deal with the subjects like Telecommunications

Journal Ratings by Zaporizhzhe National Technical University

This Particular Journal got reviewed and rated by Zaporizhzhe National Technical University and short form of this particular Institution is UA and gave this Journal an Excellent Rating.