Atomic Boxes: Coordinated Exception Handling with Transactional Memory

  • Derin Harmanci
  • Vincent Gramoli
  • Pascal Felber
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6813)


In concurrent programs raising an exception in one thread does not prevent others from operating on an inconsistent shared state. Instead, exceptions should ideally be handled in coordination by all the threads that are affected by their cause.

In this paper, we propose a Java language extension for coordinated exception handling where a named abox (atomic box) is used to demarcate a region of code that must execute atomically and in isolation. Upon an exception raised inside an abox, threads executing in dependent aboxes, roll back their changes, and execute their recovery handler in coordination. We provide a dedicated compiler framework, CXH, to evaluate experimentally our atomic box construct. Our evaluation indicates that, in addition to enabling recovery, an atomic box executes a reasonably small region of code twice as fast as when using a failbox, the existing coordination alternative that has no recovery support.


error recovery concurrent programs failure atomicity 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Cabral, B., Marques, P.: Exception handling: A field study in Java and.NET. In: Ernst, E. (ed.) ECOOP 2007. LNCS, vol. 4609, pp. 151–175. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  2. 2.
    Stelting, S.: Robust Java: Exception Handling, Testing and Debugging. Prentice Hall, New Jersey (2005)Google Scholar
  3. 3.
    Jacobs, B., Piessens, F.: Failboxes: Provably safe exception handling. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 470–494. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  4. 4.
    Harris, T., Larus, J.R., Rajwar, R.: Transactional Memory, 2nd edn. Synthesis Lectures on Computer Architecture. Morgan & Claypool Publishers, San Francisco (2010)Google Scholar
  5. 5.
    Spector, A.Z., Daniels, D.S., Duchamp, D., Eppinger, J.L., Pausch, R.F.: Distributed transactions for reliable systems. In: SOSP, pp. 127–146 (1985)Google Scholar
  6. 6.
    Liskov, B.: Distributed programming in Argus. Commun. ACM 31, 300–312 (1988)CrossRefGoogle Scholar
  7. 7.
    Haines, N., Kindred, D., Morrisett, J.G., Nettles, S.M., Wing, J.M.: Composing first-class transactions. ACM Trans. Program. Lang. Syst. 16, 1719–1736 (1994)CrossRefGoogle Scholar
  8. 8.
    Jimenez-Peris, R., Patino-Martinez, M., Arevalo, S., Peris, R.J., Ballesteros, F., Carlos, J.: Translib: An Ada 95 object oriented framework for building transactional applications (2000)Google Scholar
  9. 9.
    Kienzle, J., Romanovsky, A.: Combining tasking and transactions, part II: Open multithreaded transactions. In: IRTAW 2000, pp. 67–74 (2001)Google Scholar
  10. 10.
    Xu, J., Randell, B., Romanovsky, A., Rubira, C.M.F., Stroud, R.J., Wu, Z.: Fault tolerance in concurrent object-oriented software through coordinated error recovery. In: FTCS, pp. 499–508 (1995)Google Scholar
  11. 11.
    Capozucca, A., Guelfi, N., Pelliccione, P., Romanovsky, A., Zorzo, A.F.: Frameworks for designing and implementing dependable systems using coordinated atomic actions: A comparative study. J. Syst. Softw. 82, 207–228 (2009)CrossRefGoogle Scholar
  12. 12.
    Beder, D.M., Randell, B., Romanovsky, A., Rubira, C.M.F.: On applying coordinated atomic actions and dependable software architectures for developing complex systems. In: ISORC, pp. 103 –112 (2001)Google Scholar
  13. 13.
    Zorzo, A.F., Stroud, R.J.: A distributed object-oriented framework for dependable multiparty interactions. In: OOPSLA, pp. 435–446 (1999)Google Scholar
  14. 14.
    Filho, F., Rubira, C.M.F.: Implementing coordinated error recovery for distributed object-oriented systems with AspectJ. J. of Universal Computer Science 10(7), 843–858 (2004)Google Scholar
  15. 15.
    Ziarek, L., Schatz, P., Jagannathan, S.: Stabilizers: A modular checkpointing abstraction for concurrent functional programs. In: ICFP, pp. 136–147 (2006)Google Scholar
  16. 16.
    Scherer III, W.N., Scott, M.L.: Advanced contention management for dynamic software transactional memory. In: PODC, pp. 240–248 (2005)Google Scholar
  17. 17.
    Guerraoui, R., Herlihy, M., Kapalka, M., Pochon, B.: Robust contention management in software transactional memory. In: SCOOL (2005)Google Scholar
  18. 18.
    Herlihy, M., Moss, J.E.B.: Transactional memory: Architectural support for lock-free data structures. In: ISCA, pp. 289–300 (1993)Google Scholar
  19. 19.
    Shavit, N., Touitou, D.: Software transactional memory. In: PODC, pp. 204–213 (1995)Google Scholar
  20. 20.
    Herlihy, M., Luchangco, V., Moir, M., Scherer III, W.N.: Software transactional memory for dynamic-sized data structures. In: PODC, pp. 92–101 (2003)Google Scholar
  21. 21.
    Harris, T., Fraser, K.: Language support for lightweight transactions. In: OOPSLA, pp. 388–402 (2003)Google Scholar
  22. 22.
    Dalessandro, L., Marathe, V., Spear, M., Scott, M.: Capabilities and limitations of library-based software transactional memory in C++. In: Transact (2007)Google Scholar
  23. 23.
    Dice, D., Shalev, O., Shavit, N.: Transactional locking II. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 194–208. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  24. 24.
    Riegel, T., Felber, P., Fetzer, C.: A lazy snapshot algorithm with eager validation. In: Dolev, S. (ed.) DISC 2006. LNCS, vol. 4167, pp. 284–298. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  25. 25.
    Felber, P., Gramoli, V., Guerraoui, R.: Elastic transactions. In: Keidar, I. (ed.) DISC 2009. LNCS, vol. 5805, pp. 93–107. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  26. 26.
    Shinnar, A., Tarditi, D., Plesko, M., Steensgaard, B.: Integrating support for undo with exception handling. Technical Report MSR-TR-2004-140, Microsoft Research (2004)Google Scholar
  27. 27.
    Cabral, B., Marques, P.: Implementing retry - featuring AOP. In: Fourth Latin-American Symposium on Dependable Computing, pp. 73–80 (2009)Google Scholar
  28. 28.
    Harris, T.: Exceptions and side-effects in atomic blocks. Sci. Comput. Program. 58(3), 325–343 (2005)CrossRefMATHMathSciNetGoogle Scholar
  29. 29.
    Harris, T., Marlow, S., Peyton-Jones, S., Herlihy, M.: Composable memory transactions. In: PPoPP, pp. 48–60 (2005)Google Scholar
  30. 30.
    Fetzer, C., Felber, P.: Improving program correctness with atomic exception handling. J. of Universal Computer Science 13(8), 1047–1072 (2007)Google Scholar
  31. 31.
    Volos, H., Tack, A.J., Goyal, N., Swift, M.M., Welc, A.: xCalls: Safe I/O in memory transactions. In: EuroSys, pp. 247–260 (2009)Google Scholar
  32. 32.
    Porter, D.E., Hofmann, O.S., Rossbach, C.J., Benn, A., Witchel, E.: Operating system transactions. In: SOSP, pp. 161–176 (2009)Google Scholar
  33. 33.
    Korland, G., Shavit, N., Felber, P.: Deuce: Noninvasive software transactional memory in Java. Transactions on HiPEAC 5(2) (2010)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Derin Harmanci
    • 1
  • Vincent Gramoli
    • 1
    • 2
  • Pascal Felber
    • 1
  1. 1.University of NeuchâtelSwitzerland
  2. 2.EPFLSwitzerland

Personalised recommendations