Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transactional contention Management as a Non- Clairvoyant Scheduling Problem Hagit Attiya, Leah Epstein, Hadas Shachnai, Tami Tamir Presented by Anastasia.

Similar presentations


Presentation on theme: "Transactional contention Management as a Non- Clairvoyant Scheduling Problem Hagit Attiya, Leah Epstein, Hadas Shachnai, Tami Tamir Presented by Anastasia."— Presentation transcript:

1 Transactional contention Management as a Non- Clairvoyant Scheduling Problem Hagit Attiya, Leah Epstein, Hadas Shachnai, Tami Tamir Presented by Anastasia Braginsky

2 Agenda Motivation Motivation Transactional Synchronization (Contention Manager CM) Transactional Synchronization (Contention Manager CM) Non-Clairvoyant Scheduler (CM) Non-Clairvoyant Scheduler (CM) Contention Manager properties and GREEDY Contention Manager properties and GREEDY Model and Problem statement Model and Problem statement GREEDY algorithm is O(s)-competitive GREEDY algorithm is O(s)-competitive Lower bounds: Lower bounds: –GREEDY is optimal –Lower bound for variable first-request Summary Summary

3 Motivation T1 T2 T3 R1 R2 R3 R4 Scheduler = Contention Manager  R2  R4  R2 12 1 2 3 Wait

4 Motivation T1 T2 T3 R1 R2 R3 R4 Scheduler  R2 !!! 12 1 2 3  R2 T4  R4 Commit Abort Conflict

5 Motivation T2 T3 R1 R2 R3 R4 Scheduler 12 1 2 3 T4  R2  R1 !!!  R1 T5  R1 Abort Wait

6 Motivation T2 T3 R1 R2 R3 R4 Scheduler 12 1 2 3 T4  R1 !!! !!! T5  R1 !!!  R4 T6  R3 !!! T7  R4 T8  R3 !!! !!! T9  R2 !!! !!! !!! T10  R2 T11  R1 !!! !!! !!! T12  R2

7 Agenda Motivation Motivation Transactional Synchronization (Contention Manager - CM) Transactional Synchronization (Contention Manager - CM) Non-Clairvoyant Scheduler (CM) Non-Clairvoyant Scheduler (CM) Contention Manager properties and GREEDY Contention Manager properties and GREEDY Model and Problem statement Model and Problem statement GREEDY algorithm is O(s)-competitive GREEDY algorithm is O(s)-competitive Lower bounds: Lower bounds: –GREEDY is optimal –Lower bound for variable first-request Summary Summary

8 Transactional Synchronization Contention Manager (CM) for transactional synchronization should consider the following: Contention Manager (CM) for transactional synchronization should consider the following: –Which transaction should get the resource among some of them that got a conflict? –Which one and when transaction should be aborted or wait ? –Is a deadlock or live-lock possible? –How to make it in shorter time?

9 Transactional Synchronization Goal A major challenge lies in guaranteeing progress in shorter time A major challenge lies in guaranteeing progress in shorter time –Choose which of the conflicting transactions to abort so as to ensure that all transactions eventually commit Quantitatively, the goal is to minimize the throughput, measured by minimizing the makespan – the total time needed to complete a final set of transactions Quantitatively, the goal is to minimize the throughput, measured by minimizing the makespan – the total time needed to complete a final set of transactions

10 Transactional Synchronization Design Points Transaction progress is guaranteed when there is no conflicts – obstruction-freedom Transaction progress is guaranteed when there is no conflicts – obstruction-freedom Whenever a conflict occurs, only one of the transactions involved can proceed Whenever a conflict occurs, only one of the transactions involved can proceed

11 How to measure the performance of CM? By comparing it to another contention manager – the optimal one! By comparing it to another contention manager – the optimal one! –The known technique of the algorithm ’ s analysis is to look on the ratio between results of investigated offline algorithm and the results of the optimal online algorithm – competitive ratio competitive ratio = ______________________________ investigated algorithm’s results optimal algorithm’s (OPT’s) results

12 Agenda Motivation Motivation Transactional Synchronization (Contention Manager - CM) Transactional Synchronization (Contention Manager - CM) Non-Clairvoyant Scheduler (CM) Non-Clairvoyant Scheduler (CM) Contention Manager properties and GREEDY Contention Manager properties and GREEDY Model and Problem statement Model and Problem statement GREEDY algorithm is O(s)-competitive GREEDY algorithm is O(s)-competitive Lower bounds: Lower bounds: –GREEDY is optimal –Lower bound for variable first-request Summary Summary

13 Non-Clairvoyant Scheduling A non-clairvoyant scheduler doesn ’ t know the characteristics of the job a priory A non-clairvoyant scheduler doesn ’ t know the characteristics of the job a priory Non-clairvoyant scheduler d c b a e f abc

14 Non-Clairvoyant Scheduling A non-clairvoyant scheduler doesn ’ t know the characteristics of the job a priory A non-clairvoyant scheduler doesn ’ t know the characteristics of the job a priory Optimal – clairvoyant – scheduler knows all the job ’ s characteristics in advance Optimal – clairvoyant – scheduler knows all the job ’ s characteristics in advance Non-clairvoyant scheduler d e f abcdef Clairvoyant scheduler d c b a e f decabf

15 Adaptation of non- clairvoyant model Transaction  job Transaction  job Optimal Contention Manager (OPT) knows: Optimal Contention Manager (OPT) knows: –the accesses that will be performed by each transaction –when access will be released –the transaction ’ s duration

16 Contention manager (CM) quality The quality of CM is measured by the makespan The quality of CM is measured by the makespan For a scheduling algorithm A and a set S of jobs, makespan(A,S) denotes the latest completion time of all jobs under A For a scheduling algorithm A and a set S of jobs, makespan(A,S) denotes the latest completion time of all jobs under A b c a d bcad S A b makespan(A,S) B acbd makespan(B,S)

17 Contention manager (CM) quality The quality of CM is measured by the makespan The quality of CM is measured by the makespan For a scheduling algorithm A and a set S of jobs, makespan(A,S) denotes the latest completion time of all jobs under A For a scheduling algorithm A and a set S of jobs, makespan(A,S) denotes the latest completion time of all jobs under A –S is omitted when clear from the context competitive ratio for CM alg. A = ____________________ makespan(A) makespan(OPT’s)

18 Agenda Motivation Motivation Transactional Synchronization (Contention Manager - CM) Transactional Synchronization (Contention Manager - CM) Non-Clairvoyant Scheduler (CM) Non-Clairvoyant Scheduler (CM) Contention Manager properties and GREEDY Contention Manager properties and GREEDY Model and Problem statement Model and Problem statement GREEDY algorithm is O(s)-competitive GREEDY algorithm is O(s)-competitive Lower bounds: Lower bounds: –GREEDY is optimal –Lower bound for variable first-request Summary Summary

19 CM ’ s properties PROPERTY 1: PROPERTY 1: –A contention manager is work conserving if it always let a maximal set of non-conflicting transactions to run PROPERTY 2: PROPERTY 2: –A contention manager obeys the pending commit property if, at any time, some running transaction will execute uninterrupted until it commits

20 Considered CM We consider only contention managers that satisfy those two properties We consider only contention managers that satisfy those two properties We will show that every (such) CM achieves O( s ) competitive ratio, where s is the number of recourses We will show that every (such) CM achieves O( s ) competitive ratio, where s is the number of recourses

21 GREEDY alg. for Contention Manager Jobs/transactions are processed greedily whenever possible Jobs/transactions are processed greedily whenever possible –Maximal independent set of jobs that are non conflicting over their first requested resources are processed each time When a transaction begins, it is assigned a unique timestamp, so that earlier ( “ older ” ) transactions have a smaller timestamps When a transaction begins, it is assigned a unique timestamp, so that earlier ( “ older ” ) transactions have a smaller timestamps

22 GREEDY alg. for Contention Manager If transaction J requires a resource modified by another pending transaction J’ then: If transaction J requires a resource modified by another pending transaction J’ then: –If J is earlier than J ’ (has a smaller timestamp) then J ’ aborts –Otherwise J waits J ’ to complete Resembles classical deadlock prevention schemes Resembles classical deadlock prevention schemes

23 GREEDY example T1 T2 T3 R1 R2 R3 R4 Scheduler  R2  R4  R2 12 1 2 3 Wait 1 2 3 Possible maximal set Another possible maximal set

24 T1 T4 GREEDY example T2 T3 R1 R2 R3 R4 Scheduler  R2 !!! 12 1 2 3  R2  R1 1 2 3 4 Wait  R3 MaximalNon-conflictingSet Wait Conflict: T2 asks for R2 held by T1 But T2 > T1 (younger)  T2 waits

25 T3 T2 T1 T4 GREEDY example R1 R2 R3 R4 Scheduler  R2 !!! !!! 12 1 2 3 1 2 3 4 Commit  R3  R1 Conflict: T2 asks for R3 held by T4, but here T2<T4 (older)  T4 aborted Abort

26 GREEDY and properties GREEDY is both work conserving and obeys the pending commit property GREEDY is both work conserving and obeys the pending commit property GREEDY is decentralized contention manager GREEDY is decentralized contention manager

27 Agenda Motivation Motivation Transactional Synchronization Transactional Synchronization Non-Clairvoyant Scheduler(Contention Manager) Non-Clairvoyant Scheduler(Contention Manager) Contention Manager properties and GREEDY Contention Manager properties and GREEDY Model and Problem statement Model and Problem statement GREEDY algorithm is O(s)-competitive GREEDY algorithm is O(s)-competitive Lower bounds: Lower bounds: –GREEDY is optimal –Lower bound for variable first-request Summary Summary

28 Definitions Set of n ≥1 transactions or jobs J 1, …,J n Set of n ≥1 transactions or jobs J 1, …,J n Set of s ≥1 shared resources R 1, …,R s Set of s ≥1 shared resources R 1, …,R s Each transaction is a sequence of read or write accesses to a single resource, and commit or abort actions. Each transaction is a sequence of read or write accesses to a single resource, and commit or abort actions. The duration of the transaction J i is denoted d i The duration of the transaction J i is denoted d i

29 Definitions - continuation Transactions may access different resources in different invocations Transactions may access different resources in different invocations –OPT knows the sequence of accesses of the transactions to resources in each execution A transaction is pending after its first action (read or write) until its last action (commit or abort) A transaction is pending after its first action (read or write) until its last action (commit or abort) Two action of the same transaction can not occur at the same time Two action of the same transaction can not occur at the same time

30 Conflict definition Any two accesses of different transactions to the same resource, when at least one of them is a write access Any two accesses of different transactions to the same resource, when at least one of them is a write access –Notice that definition can have another variations due to sequential consistency definition

31 Assumption 1 The amount of exclusive (write) accesses to the resources performed by J 1, …,J n is non- negligible The amount of exclusive (write) accesses to the resources performed by J 1, …,J n is non- negligible Formally: the total duration of write actions is at least where is some constant Formally: the total duration of write actions is at least where is some constant

32 Observation on the decisions of OPT Claim1:There is an algorithm OPT that achieves the minimum makespan and schedules each job exactly once Claim1:There is an algorithm OPT that achieves the minimum makespan and schedules each job exactly once Proof: Any execution with minimum makespan can be modified so as to remove all partial executions Proof: Any execution with minimum makespan can be modified so as to remove all partial executions

33 Agenda Motivation Motivation Transactional Synchronization Transactional Synchronization Non-Clairvoyant Scheduler (Contention Manager) Non-Clairvoyant Scheduler (Contention Manager) Contention Manager properties and GREEDY Contention Manager properties and GREEDY Model and Problem statement Model and Problem statement GREEDY algorithm is O(s)-competitive GREEDY algorithm is O(s)-competitive Lower bounds: Lower bounds: –GREEDY is optimal –Lower bound for variable first-request Summary Summary

34 Supporting claim Consider the sequence of idle time intervals, I 1, …, I k in which no job is running under GREEDY Consider the sequence of idle time intervals, I 1, …, I k in which no job is running under GREEDY and the sequence of time intervals I ’ 1, …, I ’ l in which no job is running under OPT and the sequence of time intervals I ’ 1, …, I ’ l in which no job is running under OPT Claim2: There exist an optimal scheduler in which the total idle time is at least the total idle time of GREEDY. Formally: Claim2: There exist an optimal scheduler in which the total idle time is at least the total idle time of GREEDY. Formally: –Actually true for every work conserving CM

35 Supporting claim pictorial proof GREEDY is idle at a certain time only after completing all jobs available at that time GREEDY is idle at a certain time only after completing all jobs available at that time –Because GREEDY is work conserving (property 1) GREEDY: T1 T2 T3 Impossible interval for GREEDY!

36 Supporting claim pictorial proof GREEDY: T1 T2 T3 0t1t1 t2t2 T4 I 1 = [t 1, t 2 ] During [0, t 1 ] GREEDY is processing some set of jobs S OPT: T1 T3 T2 OPT completes the S at time at most t 1 and is idle till t 2 I’ 1 = [t’ 1, t 2 ]

37 Supporting claim proof Looking on the time till t 2 Looking on the time till t 2 There exists an optimal scheduler with total idle time at least | I 1 | till time t 2 There exists an optimal scheduler with total idle time at least | I 1 | till time t 2 Continuing the same way, for each prefix of idle intervals, we get that for any j, 1≤j ≤k Continuing the same way, for each prefix of idle intervals, we get that for any j, 1≤j ≤k –k is the number of GREEDY ’ s idle intervals There exist an optimal scheduler with total idle time at least ∑ j i=1 | I i | till the end time of I j There exist an optimal scheduler with total idle time at least ∑ j i=1 | I i | till the end time of I j

38 Supporting claim proof (continuation) In particular for j=k In particular for j=k There exist an optimal scheduler with total idle time at least ∑ k i=1 | I i | till the end time of I k There exist an optimal scheduler with total idle time at least ∑ k i=1 | I i | till the end time of I k ∑ k j=1 | I j | ≤ ∑ l j=1 | I’ j | ∑ k j=1 | I j | ≤ ∑ l j=1 | I’ j | GREEDY’s idle time OPT’s idle time

39 Theorem1: GREEDY is O(s)- competitive Actually true for every work conserving CM that obeys the pending commit property Actually true for every work conserving CM that obeys the pending commit property

40 Proof - observation Consider the set of write actions of all transactions Consider the set of write actions of all transactions If s+1 transactions are proceeding with write accesses concurrently, the pigeonhole principle implies that at least two of them are accessing the same resource and thus will be aborted or will need to wait If s+1 transactions are proceeding with write accesses concurrently, the pigeonhole principle implies that at least two of them are accessing the same resource and thus will be aborted or will need to wait At most s write accesses can be done concurrently At most s write accesses can be done concurrently

41 Possibilities R1 R2 R3 T1 Write(R1)Read(R2)Read(R3) T2 Write(R3)Read(R2)Write(R2) Write accesses T3 Write(R2)

42 Possibilities R1 R2 R3 T1 Read(R1)Read(R2)Read(R3) T2 Write(R2) Duration of all write actions ≥

43 Proof According to Claim1 no job is aborted in the execution of OPT According to Claim1 no job is aborted in the execution of OPT makespan(OPT) = Idle Time + Working Time makespan(OPT) ≥

44 Proof – the end When the GREEDY is not idle, at least one of the jobs that are processed will be completed (GREEDY obeys pending commit property) When the GREEDY is not idle, at least one of the jobs that are processed will be completed (GREEDY obeys pending commit property) makespan(GREEDY) makespan(GREEDY) makespan(OPT) makespan(OPT) competitive ratio = ___________________ makespan(GREEDY) makespan(OPT)

45 Agenda Motivation Motivation Transactional Synchronization Transactional Synchronization Non-Clairvoyant Scheduler(Contention Manager) Non-Clairvoyant Scheduler(Contention Manager) Contention Manager properties and GREEDY Contention Manager properties and GREEDY Model and Problem statement Model and Problem statement GREEDY algorithm is O(s)-competitive GREEDY algorithm is O(s)-competitive Lower bounds for contention managers: Lower bounds for contention managers: –GREEDY is optimal –Lower bound for variable first-request Summary Summary

46 Theorem2: Any work-conserving deterministic CM is Ω(s)-competitive Thus GREEDY is optimal Thus GREEDY is optimal To prove the theorem we will show an example of possible run where any work- conserving deterministic contention manager can be at most s-competitive To prove the theorem we will show an example of possible run where any work- conserving deterministic contention manager can be at most s-competitive

47 The proof example – preparations Assume that s (number of reasorces in the system) is even: s=2k (k=s/2) Assume that s (number of reasorces in the system) is even: s=2k (k=s/2) We ’ ll need to execute n=ks ( =2k 2 =s 2 /2) unit length jobs (same duration) We ’ ll need to execute n=ks ( =2k 2 =s 2 /2) unit length jobs (same duration) All transactions available at time 0 All transactions available at time 0 Each job j requests a pair of resources (R j1,R j2 ) Each job j requests a pair of resources (R j1,R j2 ) –Resource R j1 requested at the beginning of the transaction and R j2 is requested after (1-ε) unit of time Online algorithm doesn ’ t know R j2 in advance! Online algorithm doesn ’ t know R j2 in advance!

48 The set of jobs k…321 (1,2k) …(1,6)(1,4)(1,2)1 (3,2k) …(3,6)(3,4)(3,2)2 (5,2k) …(5,6)(5,4)(5,2)3 ……………… (2k-1,2k) …(2k-1,6)(2k-1,4) (2k-1,2) k (2,2k-1) …(2,5)(2,3)(2,1)1 (4,2k-1) …(4,5)(4,3)(4,1)2 (6,2k-1) …(6,5)(6,3)(6,1)3 ……………… (2k,2k-1) … (2k,5) (2k,3) (2k,1) k Jobs that require odd resource first, but even second Jobs that require even resource first, but odd second

49 The set of jobs k…321 ( 1,2k) … ( 1,6) ( 1,4) ( 1,2) 1 ( 3,2k) … ( 3,6) ( 3,4) ( 3,2) 2 ( 5,2k) … ( 5,6) ( 5,4) ( 5,2) 3 ……………… ( 2k-1,2k) … ( 2k-1,6) ( 2k-1,4) ( 2k-1,2) k ( 2,2k-1) … ( 2,5) ( 2,3) ( 2,1) 1 ( 4,2k-1) … ( 4,5) ( 4,3) ( 4,1) 2 ( 6,2k-1) … ( 6,5) ( 6,3) ( 6,1) 3 ……………… ( 2k,2k-1) … ( 2k,5) ( 2k,3) ( 2k,1) k Work conserving CM must select an independent set of s=2k jobs

50 The set of jobs k…321 ( 1,2k) … ( 1,6) ( 1,4) (1,2)(1,2)(1,2)(1,2)1 ( 3,2k) … ( 3,6) ( 3,4) (3,2)(3,2)(3,2)(3,2)2 ( 5,2k) … ( 5,6) ( 5,4) (5,2)(5,2)(5,2)(5,2)3 ……………… ( 2k-1,2k) … ( 2k-1,6) ( 2k-1,4) ( 2k-1, 2 ) k ( 2,2k-1) … ( 2,5) ( 2,3) (2,1)(2,1)(2,1)(2,1)1 ( 4,2k-1) … ( 4,5) ( 4,3) (4,1)(4,1)(4,1)(4,1)2 ( 6,2k-1) … ( 6,5) ( 6,3) (6,1)(6,1)(6,1)(6,1)3 ……………… ( 2k,2k-1) … ( 2k,5) ( 2k,3) ( 2k, 1 ) k At most two can complete, while other s-2 jobs must abort

51 The set of jobs k…321 ( 1,2k) … ( 1,6) ( 1,4) (1,2)(1,2)(1,2)(1,2)1 ( 3,2k) … ( 3,6) ( 3,4) ( 1,2) 2 ( 5,2k) … ( 5,6) ( 5,4) ( 1,2) 3 ……………… ( 2k-1,2k) … ( 2k-1,6) ( 2k-1,4) ( 1,2) k ( 2,2k-1) … ( 2,5) ( 2,3) ( 1,1) 1 ( 4,2k-1) … ( 4,5) ( 4,3) ( 1,1) 2 ( 6,2k-1) … ( 6,5) ( 6,3) ( 1,1) 3 ……………… ( 2k,2k-1) … ( 2k,5) ( 2k,3) ( 1,1) k All aborted jobs request R 1 (1) in any subsequent execution! On next step work conserving CM must select an independent set of s=2k jobs

52 The set of jobs k…321 ( 1,2k) … ( 1,6) (1,4)(1,4)(1,4)(1,4) (1,2)(1,2)(1,2)(1,2)1 ( 3,2k) … ( 3,6) (3,4)(3,4)(3,4)(3,4) ( 1,2) 2 ( 5,2k) … ( 5,6) (5,4)(5,4)(5,4)(5,4) ( 1,2) 3 ……………… ( 2k-1,2k) … ( 2k-1,6) ( 2k-1, 4 ) ( 1,2) k ( 2,2k-1) … ( 2,5) (2,3)(2,3)(2,3)(2,3) ( 1,1) 1 ( 4,2k-1) … ( 4,5) (4,3)(4,3)(4,3)(4,3) ( 1,1) 2 ( 6,2k-1) … ( 6,5) (6,3)(6,3)(6,3)(6,3) ( 1,1) 3 ……………… ( 2k,2k-1) … ( 2k,5) ( 2k, 3 ) ( 1,1) k Again at most two can complete, while other s-2 jobs must abort

53 The set of jobs k…321 ( 1,2k) … ( 1,6) (1,4)(1,4)(1,4)(1,4) (1,2)(1,2)(1,2)(1,2)1 ( 1,2k) … ( 3,6) ( 1,4) ( 1,2) 2 ( 1,2k) … ( 1,6) ( 1,4) ( 1,2) 3 ……………… ( 2k-1,2k) … ( 1,6) ( 1,4) ( 1,2) k ( 1,2k-1) … ( 1,5) ( 1,3) ( 1,1) 1 ( 4,2k-1) … ( 1,5) ( 1,3) ( 1,1) 2 ( 1,2k-1) … ( 6,5) ( 1,3) ( 1,1) 3 ……………… ( 1,2k-1) … ( 1,5) ( 1,3) ( 1,1) k After the first k time-slots, 2k jobs are completed From now no more parallelism is possible  So makespan of any work conserving CM is 2k 2 -k =2(s 2 /4)-s/2 =s(s-1)/2

54 On the other side … kk-1…321 (1,2k) (1,2k-2) …(1,6)(1,4)(1,2)1 (3,2k) (3,2k-2) …(3,6)(3,4)(3,2)2 (5,2k) (5,2k-2) …(5,6)(5,4)(5,2)3 ………………… (2k-1,2k) (2k-1,2k-2) …(2k-1,6)(2k-1,4) (2k-1,2) k (2,2k-1) …(2,5)(2,3)(2,1)1 (4,2k-1) …(4,5)(4,3)(4,1)2 (6,2k-1) …(6,5)(6,3)(6,1)3 ………………… (2k,2k-1) … (2k,5) (2k,3) (2k,1) k

55 The end of the proof The optimal scheduler can process k transactions (among 2k 2 we have) at each time slot The optimal scheduler can process k transactions (among 2k 2 we have) at each time slot So it finishes after 2k 2 /k=2k =s So it finishes after 2k 2 /k=2k =s Theorem2: Any work-conserving deterministic CM is Ω(s)- competitive competitive ratio = ________________________ = ________ = (s-1)/2 = Ω(s) makespan(Work-Conserving) makespan(OPT) s s(s-1)/2

56 Agenda Motivation Motivation Transactional Synchronization Transactional Synchronization Non-Clairvoyant Scheduler(Contention Manager) Non-Clairvoyant Scheduler(Contention Manager) Contention Manager properties and GREEDY Contention Manager properties and GREEDY Model and Problem statement Model and Problem statement GREEDY algorithm is O(s)-competitive GREEDY algorithm is O(s)-competitive Lower bounds for contention managers: Lower bounds for contention managers: –GREEDY is optimal –Lower bound for variable first-request Summary Summary

57 Variable first-request model As before any job j arriving to the system requests it first resource As before any job j arriving to the system requests it first resource However, while waiting to start its execution, j may modify the request to another resource However, while waiting to start its execution, j may modify the request to another resource Thus the online algorithm knows the first resource requested by any job only when this job starts running Thus the online algorithm knows the first resource requested by any job only when this job starts running

58 Theorem 3 Any algorithm in the model where the first request for any resource is time dependent has competitive ratio of Ω(s) Any algorithm in the model where the first request for any resource is time dependent has competitive ratio of Ω(s) Proof again by example Proof again by example

59 Proof preparations s – number of resources s – number of resources Define another value: Define another value: Each job has unit-length and will have a single resource request Each job has unit-length and will have a single resource request Job reveals the information regarding the resource it is going to need, each time it restarts Job reveals the information regarding the resource it is going to need, each time it restarts

60 Proof A 1 J 1 1 J 1 2 J 1 3. J 1 2s ’ … A 2 J 2 1 J 2 2 J 2 3. J 2 2s ’ A 2s ’ J 2s ’ 1 J 2s ’ 2 J 2s ’ 3. J 2s ’ 2s ’ First, there are 2s’ sets of jobs. Each set contains 2s’ jobs 2s’2s’ 2s’2s’ All jobs in set A i initially request resource i (2s’ = s)

61 A 1 J 1 1 =(1) J 1 2 =(1) J 1 3 =(1). J 1 2s ’ =(1) A 2 J 2 1 =(2) J 2 2 =(2) J 2 3 =(2). J 2 2s ’ =(2) A 2s ’ J 2s ’ 1 =(2s ’ ) J 2s ’ 2 =(2s ’ ) J 2s ’ 3 =(2s ’ ). J 2s ’ 2s ’ =(2s ’ ) Proof … First, there are 2s’ sets of jobs. Each set contains 2s’ jobs 2s’2s’ 2s’2s’ All jobs in set A i initially request resource i (2s’ = s) At first s’ time units online alg. can run 2s’ jobs in each time unit ( 2s ’ 2 jobs completed and 2s ’ 2 remain)

62 A 1 J 1 1 =(1) J 1 2 =(1) J 1 3 =(1). J 1 2s ’ =(1) A 2 J 2 1 =(2) J 2 2 =(2) J 2 3 =(2). J 2 2s ’ =(2) A 2s ’ J 2s ’ 1 =(2s ’ ) J 2s ’ 2 =(2s ’ ) J 2s ’ 3 =(2s ’ ). J 2s ’ 2s ’ =(2s ’ ) Proof … 2s’2s’ 2s’2s’ Now define offline alg. according to the online one Partition each set A i into B i and C i C i contains all jobs in A i that the online alg. completed by time s’ Jobs from C 1 Jobs from C 2 Jobs from B 1 All the rest is B i

63 A 1 J 1 1 =(1) J 1 2 =(1) J 1 3 =(1). J 1 2s ’ =(1) A 2 J 2 1 =(2) J 2 2 =(2) J 2 3 =(1). J 2 2s ’ =(1) A 2s ’ J 2s ’ 1 =(2s ’ ) J 2s ’ 2 =(2s ’ ) J 2s ’ 3 =(1). J 2s ’ 2s ’ =(1) Proof … 2s’2s’ 2s’2s’ Now define offline alg. according to the online one Partition each set A i into B i and C i C i contains all jobs in A i that the online alg. completed by time s’ Jobs from C 1 Jobs from C 2 Jobs from B 1 All the rest is B i

64 At time s ’ The jobs in every B i start request resource R 1 when they start running The jobs in every B i start request resource R 1 when they start running Online algorithm runs jobs from every B i after s ’ Online algorithm runs jobs from every B i after s ’ So we define that offline algorithm runs jobs from every B i before s ’ So we define that offline algorithm runs jobs from every B i before s ’ Jobs from C i doesn ’ t change their requests Jobs from C i doesn ’ t change their requests Thus offline algorithm run 2s ’ jobs in each time unit Thus offline algorithm run 2s ’ jobs in each time unit While offline algorithm needs 2s ’ 2 time units after it already used s ’ While offline algorithm needs 2s ’ 2 time units after it already used s ’

65 And the winner is … makespan(online) = 2s ’ 2 +s ’ makespan(online) = 2s ’ 2 +s ’ makespan(offline) = 2s ’ makespan(offline) = 2s ’ competitive ratio = s ’ +1/2 = competitive ratio = s ’ +1/2 = s/2+1/2 = Ω(s) s/2+1/2 = Ω(s)

66 GREEDY remains s-competitive The proof of Theorem 1 makes no assumption on identities of the resources requested The proof of Theorem 1 makes no assumption on identities of the resources requested Thus note that also in new system GREEDY (and others) remain O(s)-competitive also here – upper bound Thus note that also in new system GREEDY (and others) remain O(s)-competitive also here – upper bound

67 For randomized algorithms The only change: C i will be the set of elements of A i with the highest probability to be run by randomized online algorithm by time s ’ The only change: C i will be the set of elements of A i with the highest probability to be run by randomized online algorithm by time s ’

68 Proof for randomized alg. X i (Y i ) – the number of elements of B i (C i ) that have been completed by offline (online) algorithm by time s ’ X i (Y i ) – the number of elements of B i (C i ) that have been completed by offline (online) algorithm by time s ’

69 And one more result There can be also another model of transactional memory system – where transaction may fail There can be also another model of transactional memory system – where transaction may fail Assume transaction may fail at most k times Assume transaction may fail at most k times Then it can be shown that the simple adaptation of GREEDY has O(ks) competitive ratio Then it can be shown that the simple adaptation of GREEDY has O(ks) competitive ratio In variable first-request model, it can be shown that any deterministic algorithm has a competitive ratio Ω(ks) In variable first-request model, it can be shown that any deterministic algorithm has a competitive ratio Ω(ks)

70 Agenda Motivation Motivation Transactional Synchronization Transactional Synchronization Non-Clairvoyant Scheduler(Contention Manager) Non-Clairvoyant Scheduler(Contention Manager) Contention Manager properties and GREEDY Contention Manager properties and GREEDY Model and Problem statement Model and Problem statement GREEDY algorithm is O(s)-competitive GREEDY algorithm is O(s)-competitive Lower bounds for contention managers: Lower bounds for contention managers: –GREEDY is optimal –Lower bound for variable first-request Summary Summary

71 Summary We learned the meaning and the properties of transactional contention managers We learned the meaning and the properties of transactional contention managers We have seen the example of GREEDY We have seen the example of GREEDY We have proved the upper and lower bounds on competitive ratio of contention manager under different systems We have proved the upper and lower bounds on competitive ratio of contention manager under different systems

72 References Hagit Attiya, Leah Epstein, Hadas Shachnai, Tami Tamir, Transactional contention management as a non-clairvoyant scheduling problem. PODC 2006: 308-315 Hagit Attiya, Leah Epstein, Hadas Shachnai, Tami Tamir, Transactional contention management as a non-clairvoyant scheduling problem. PODC 2006: 308-315 –Rachid Guerraoui, Maurice Herlihy, Bastian Pochon, Toward a theory of transactional contention managers. PODC 2005: 258-264 – –William N. Scherer III and Michael Scott, Advanced Contention Management for Dynamic Software Transactional Memory PODC 2005: 240-248.

73 QUESTIONS? The end The end


Download ppt "Transactional contention Management as a Non- Clairvoyant Scheduling Problem Hagit Attiya, Leah Epstein, Hadas Shachnai, Tami Tamir Presented by Anastasia."

Similar presentations


Ads by Google