Converting Parallel Code from Low-Level Abstractions to Higher-Level Abstractions

  • Semih Okur
  • Cansu Erdogan
  • Danny Dig
Conference paper

DOI: 10.1007/978-3-662-44202-9_21

Volume 8586 of the book series Lecture Notes in Computer Science (LNCS)
Cite this paper as:
Okur S., Erdogan C., Dig D. (2014) Converting Parallel Code from Low-Level Abstractions to Higher-Level Abstractions. In: Jones R. (eds) ECOOP 2014 – Object-Oriented Programming. ECOOP 2014. Lecture Notes in Computer Science, vol 8586. Springer, Berlin, Heidelberg

Abstract

Parallel libraries continuously evolve from low-level to higher-level abstractions. However, developers are not up-to-date with these higher-level abstractions, thus their parallel code might be hard to read, slow, and unscalable. Using a corpus of 880 open-source C# applications, we found that developers still use the old Thread and ThreadPool abstractions in 62% of the cases when they use parallel abstractions. Converting code to higher-level abstractions is (i) tedious and (ii) error-prone. e.g., it can harm performance and silence the uncaught exceptions.

We present two automated migration tools, Taskifier and Simplifier that work for C# code. The first tool transforms old style Thread and ThreadPool abstractions to Task abstractions. The second tool transforms code with Task abstractions into higher-level design patterns. Using our code corpus, we have applied these tools 3026 and 405 times, respectively. Our empirical evaluation shows that the tools (i) are highly applicable, (ii) reduce the code bloat, (iii) are much safer than manual transformations. We submitted 66 patches generated by our tools, and the open-source developers accepted 53.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2014

Authors and Affiliations

  • Semih Okur
    • 1
  • Cansu Erdogan
    • 1
  • Danny Dig
    • 2
  1. 1.University of Illinois at Urbana-ChampaignUSA
  2. 2.Oregon State UniversityUSA