1 / 16

AOP: Does It Make Sense? The Case of Concurrency and Failures

AOP: Does It Make Sense? The Case of Concurrency and Failures. Sibylle Aregger & Antonia Schmidig. Presentation based on. by Jörg Kienzle and Rachid Guerraoui. NO!. The Problem . aspectizing Concurrency and Failures AspectJ & Transactions aspectize transaction semantics

gabe
Télécharger la présentation

AOP: Does It Make Sense? The Case of Concurrency and Failures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AOP: Does It Make Sense?The Case of Concurrency and Failures Sibylle Aregger & Antonia Schmidig Presentation based on by Jörg Kienzle and Rachid Guerraoui

  2. NO! SS 2004

  3. The Problem • aspectizing Concurrency and Failures • AspectJ & Transactions • aspectize transaction semantics • aspectize transaction interfaces • aspectize transaction mechanisms SS 2004

  4. Overview • Transactions • AOP (Aspect Oriented Programming) • aspectize transaction semantics • aspectize transaction interfaces • aspectize transaction mechanisms • Conclusion SS 2004

  5. Transactions • ACID • Serializability • Concurrency • Failure Recovery => fundamental paradigm to handle Concurrency and Failures SS 2004

  6. AOP • separation of concerns-> separate code (aspect) • WeavingCode + Aspect(s) = Program SS 2004

  7. AOP: Example • [Picture: Figure/Point/Line Example] SS 2004

  8. AOP: JoinPoint • JoinPoint: • point in flow of program • „hook“ to insert aspect-code Program Flow JoinPoint Method SS 2004

  9. AOP: PointCut • PointCut: • set of JoinPoints pointcut moves(): receptions(void Line.setP1(Point)) || receptions(void Line.setP2(Point)) || receptions(void Point.setX(int)) || receptions(void Point.setY(int)); SS 2004

  10. AOP: Advice • Before • After • Around Program Flow JoinPoint Method SS 2004

  11. AOP: Example aspect MoveTracking { static boolean flag = false; static boolean testAndClear() { boolean result = flag; flag = false; return result; } pointcut moves() : ... after() : moves() { flag = true; } } SS 2004

  12. Aspectize Transaction Semantics • combine non-transactional code with transaction aspects • problems: • irreversible actions • deadlock SS 2004

  13. T1: A.deposit(Amount) while (B.getBalance() <= Amount) {} B.withdraw(Amount) T2: B.deposit(Amount) while (A.getBalance() <= Amount) {} A.withdraw(Amount) ATS: Unsolvable Deadlock • Problem: linearizability  serializability • Solution: multithreaded transactions • New Problem: automatic detection of cooperating threads SS 2004

  14. Aspectize Transaction Interfaces SS 2004

  15. Aspectize Transaction Mechanisms SS 2004

  16. Conclusion • aspectize transaction semantics:not possible • aspectize transaction interfaces:possible, but artificial • aspectize transaction mechanisms:only syntactical separation SS 2004

More Related