Incremental Dynamic Updates with First-Class Contexts

  • Erwann Wernli
  • Mircea Lungu
  • Oscar Nierstrasz
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7304)


Highly available software systems occasionally need to be updated while avoiding downtime. Dynamic software updates reduce downtime, but still require the system to reach a quiescent state in which a global update can be performed. This can be difficult for multi-threaded systems. We present a novel approach to dynamic updates using first-class contexts, called Theseus. First-class contexts make global updates unnecessary: existing threads run to termination in an old context, while new threads start in a new, updated context; consistency between contexts is ensured with the help of bidirectional transformations. We show how first-class contexts offer a practical and flexible approach to incremental dynamic updates, with acceptable overhead.


dynamic language dynamic software update reflection 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bergel, A.: Classboxes — Controlling Visibility of Class Extensions. Ph.D. thesis, University of Bern (November 2005)Google Scholar
  2. 2.
    Boyapati, C., Liskov, B., Shrira, L., Moh, C.H., Richman, S.: Lazy modular upgrades in persistent object stores. SIGPLAN Not. 38(11), 403–417 (2003)CrossRefGoogle Scholar
  3. 3.
    Cech Previtali, S., Gross, T.R.: Aspect-based dynamic software updating: a model and its empirical evaluation. In: Proceedings of the Tenth International Conference on Aspect-Oriented Software Development, AOSD 2011, pp. 105–116. ACM, New York (2011)CrossRefGoogle Scholar
  4. 4.
    Chen, H., Yu, J., Hang, C., Zang, B., Yew, P.C.: Dynamic software updating using a relaxed consistency model. IEEE Trans. Software Eng. 37(5), 679–694 (2011)CrossRefGoogle Scholar
  5. 5.
    Choi, A.: Online application upgrade using edition-based redefinition. In: Proceedings of the 2nd International Workshop on Hot Topics in Software Upgrades, HotSWUp 2009, pp. 4:1–4:5. ACM, New York (2009)CrossRefGoogle Scholar
  6. 6.
    Dmitriev, M.: Towards flexible and safe technology for runtime evolution of Java language applications. In: Proceedings of the Workshop on Engineering Complex Object-Oriented Systems for Evolution, in association with OOPSLA 2001 (October 2001)Google Scholar
  7. 7.
    Duggan, D.: Type-based hot swapping of running modules. In: Intl. Conf. on Functional Programming, pp. 62–73 (2001)Google Scholar
  8. 8.
    Gemstone/s programming guide (2007)Google Scholar
  9. 9.
    Gharachorloo, K.: Memory consistency models for shared-memory multiprocessors. Tech. rep., DEC (1995) Google Scholar
  10. 10.
    Gregersen, A.R., Jørgensen, B.N.: Dynamic update of Java applications — balancing change flexibility vs programming transparency. J. Softw. Maint. Evol. 21, 81–112 (2009)CrossRefGoogle Scholar
  11. 11.
    Hicks, M., Nettles, S.: Dynamic software updating. ACM Transactions on Programming Languages and Systems 27(6), 1049–1096 (2005)CrossRefGoogle Scholar
  12. 12.
    Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-oriented programming. Journal of Object Technology 7(3) (March 2008)Google Scholar
  13. 13.
    Hjálmtýsson, G., Gray, R.: Dynamic C++ classes: a lightweight mechanism to update code in a running program. In: Proceedings of the annual conference on USENIX Annual Technical Conference, ATEC 1998, p. 6. USENIX Association, Berkeley (1998)Google Scholar
  14. 14.
    Johnsen, E.B., Kyas, M., Yu, I.C.: Dynamic Classes: Modular Asynchronous Evolution of Distributed Concurrent Objects. In: Cavalcanti, A., Dams, D.R. (eds.) FM 2009. LNCS, vol. 5850, pp. 596–611. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  15. 15.
    Kabanov, J.: Jrebel tool demo. Electron. Notes Theor. Comput. Sci. 264, 51–57 (2011)CrossRefGoogle Scholar
  16. 16.
    Liang, S., Bracha, G.: Dynamic class loading in the Java virtual machine. In: Proceedings of OOPSLA 1998. ACM SIGPLAN Notices, pp. 36–44 (1998)Google Scholar
  17. 17.
    Malabarba, S., Pandey, R., Gragg, J., Barr, E., Barnes, J.F.: Runtime Support for Type-Safe Dynamic Java Classes. In: Bertino, E. (ed.) ECOOP 2000. LNCS, vol. 1850, pp. 337–361. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  18. 18.
    Neamtiu, I., Hicks, M.: Safe and timely updates to multi-threaded programs. In: Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2009, pp. 13–24. ACM, New York (2009)CrossRefGoogle Scholar
  19. 19.
    Neamtiu, I., Hicks, M., Stoyle, G., Oriol, M.: Practical dynamic software updating for C. In: Proceedings of the 2006 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2006, pp. 72–83. ACM, New York (2006)CrossRefGoogle Scholar
  20. 20.
    Orso, A., Rao, A., Harrold, M.J.: A Technique for Dynamic Updating of Java Software. In: IEEE International Conference on Software Maintenance, p. 0649+ (2002)Google Scholar
  21. 21.
    Piccioni, M., Oriol, M., Meyer, B., Schneider, T.: An ide-based, integrated solution to schema evolution of object-oriented software. In: ASE, pp. 650–654 (2009)Google Scholar
  22. 22.
    Pina, L., Cachopo, J.: Dustm - dynamic software upgrades using software transactional memory. Tech. rep., INESC-ID (2011)Google Scholar
  23. 23.
    Pukall, M., Kästner, C., Cazzola, W., Götz, S., Grebhahn, A., Schröter, R., Saake, G.: Flexible dynamic software updates of java applications: Tool support and case study. Tech. Rep. 04, School of Computer Science, University of Magdeburg (2011)Google Scholar
  24. 24.
    Pukall, M., Kästner, C., Saake, G.: Towards unanticipated runtime adaptation of java applications. In: APSEC 2008: Proceedings of the 2008 15th Asia-Pacific Software Engineering Conference, pp. 85–92. IEEE Computer Society, Washington, DC (2008)Google Scholar
  25. 25.
    Rivard, F.: Smalltalk: a reflective language. In: Proceedings of REFLECTION 1996, pp. 21–38 (April 1996)Google Scholar
  26. 26.
    Subramanian, S., Hicks, M., McKinley, K.S.: Dynamic software updates: a VM-centric approach. In: Proceedings of the 2009 ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2009, pp. 1–12. ACM, New York (2009)CrossRefGoogle Scholar
  27. 27.
    Wernli, E., Gurtner, D., Nierstrasz, O.: Using first-class contexts to realize dynamic software updates. In: Proceedings of International Workshop on Smalltalk Technologies (IWST 2011), pp. 21–31 (2011),
  28. 28.
    Würthinger, T., Wimmer, C., Stadler, L.: Unrestricted and safe dynamic code evolution for java. Science of Computer Programming (July 2011)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Erwann Wernli
    • 1
  • Mircea Lungu
    • 1
  • Oscar Nierstrasz
    • 1
  1. 1.Software Composition GroupUniversity of BernSwitzerland

Personalised recommendations