Fence-Insertion for Structured Programs Arash Pourdamghani Mohammad Taheri Mohsen Lesani Spring 2020 University of Vienna
Developing a Distributed System! 2
Looking Deeper 357 F(x) ……….. 385 F’(x) 3
Out of Order Execution F’(x) 357 F(x) ↓ ……….. 385 F’(x) F(x) Programmer's Runtime 4 Expectation Execution
Fence Insertion 500 H(x) 357 F(x) 525 H’(x) 385 F’(x) 146 G(x) 912 G’(x) 5
Our Solution 6
Outline Problem Poly-time NP-Hardness Statement Algorithm 7
CFG 8
A Closer Look h F(x) i Some Code k G(x) 9
Maintaining Correctness h F(x) i Some Code k F’(x) 10
Fence Insertion h F(x) i Some Code k F’(x) 11
All Constraints 12
Naive Solution 13
Optimization 14
Outline Problem Poly-time NP-Hardness Statement Algorithm 15
Reduction from Minimum Set Cover 𝑉 = 𝑣 1 , 𝑣 2 , 𝑣 3 , 𝑣 4 , … , u n 𝑇 = 𝑇 1 , 𝑇 2 , … , 𝑇 𝑛 𝐹𝑦𝑏𝑛𝑞𝑚𝑓: 𝑇1 = 𝑣 1 , 𝑣 2 , 𝑣 3 , 𝑇2 = {𝑣 2 , 𝑣 4 } 16
Reduction from Minimum Set Cover 𝑉 = 𝑣 1 , 𝑣 2 , 𝑣 3 , 𝑣 4 , … , u n : Constraint Types, Straight line program with 2n instructions, Constraints with type 𝑣 𝑗 𝑝𝑜 𝑤 𝑗 , 𝑤 2𝑜−𝑗+1 , 2 + 1): The middle edge (𝑤 𝑜 2 , 𝑤 𝑜 17
Reduction from Minimum Set Cover 𝑇 = 𝑇 1 , 𝑇 2 , … : Fence Types We could many fences of 𝑇 𝑗 𝐹𝑦𝑏𝑛𝑞𝑚𝑓: 𝑇1 = 𝑣 1 , 𝑣 2 , 𝑣 3 , 𝑇2 = {𝑣 2 , 𝑣 4 } 18
Given Solution of Fence Insertion 𝑉 = 𝑣 1 , 𝑣 2 , 𝑣 3 , 𝑣 4 , … 𝑇 = {𝑇 1 , 𝑇 2 , … } 19
Given Solution of Minimum Set Cover 𝑉 = 𝑉 1 , 𝑉 2 , 𝑉 3 , 𝑉 4 , … 𝑇 = {𝑇 1 , 𝑇 2 , … } 20
Outline Problem Poly-time NP-Hardness Statement Algorithm 21
P 22
Algorithm Overview 1- Constraint Elimination 2- Finding Diamond 3- Decomposing into Paths 4- Solving for Paths 23
Out of Order Execution! 4- Solving for Paths 1- Constraint Elimination 2- Finding Diamond 2- Finding Diamond 1- Constraint Elimination 3- Decomposing into Paths 3- Decomposing into Paths 4- Solving for Paths 24
A Simple Path 25
A Simple Path 26
A Simple Path 27
A Simple Path 28
A Simple Path 29
Structured 30
A(C)FG 31
Finding Diamonds 32
Level 0 33
Level 1 34
Level 2 35
Branch/Merge 36
Algorithm 37
Algorithm 38
Fence Elimination 39
Passing Constraints 40
Spanning Constraints 41
Control Dependency Preservation 42
Decomposing into simple paths 43
Absorption in a Path 44
Emission in a Path 45
Before 46
After Level 0 47
After Level 1 48
The End! 49
Complexity 1- 𝐹 ∈ 𝑃 𝑊 2-Elimination: 𝑃 𝐷 + 𝑊 3-Finding Diamonds: 𝑃 𝑊𝑚𝑝𝑊 4-Decompsiton and Insertion: σ |𝑞| |𝐷 𝑞 𝑗 |𝑚𝑝𝐷 𝑞 𝑗 + |𝑊 𝑞𝑗 | ⇒ Polynomial Time! 50
What about loops? 51
Elimination 52
Transformation 53
Thank you 54
Probabilistic Smart Contracts: Secure Randomness on the Blockchain [ICBC 2019] Propose a novel game-theoretic approach for generating provably unmanipulatable pseudorandom numbers on the blockchain. Hybrid Mining: Exploiting Blockchain's Computational Power for Distributed Problem Solving [SAC 2019] A new mining protocol that combines solving real-world useful problems with Hashcash. 55
Recommend
More recommend