Teaching and Learning Concurrent Programming in the Shared Memory Model

Abstract: The performance of computational devices is steadily increasing. Recently, the main contributor to the increasing performance has been an increasing number of cores rather than increased performance for individual cores. This trend is not only visible in high-end de-vices, such as powerful workstations, but also in low-end devices such as smartphones and many embedded devices. Due to this trend, and to the ubiquity of multicore systems, it is increasingly important for computer science students to have at least some familiarity with working with concurrent programs, as they are likely to encounter such programs in some shape or form in their future professional careers. In this thesis, we use the term concurrent programming to emphasize the focus on concurrency in a programming context, as opposed to concurrency in isolation. Prior work has shown that students struggle with learning concurrent programming. This is not surprising in and of itself, as concurrency is generally considered to be a difficult topic. To help students learn concurrent programming, it is important to consider why they find the topic difficult. As such, the first part of this thesis aims to gain better insights into these difficulties. This is done partly by studying prior work in the literature and partly by conducting new research. The results show that the struggles are not only due to the difficulty involved in understanding the new concepts related to concurrency. Rather, a large portion of students’ struggles can be attributed to the fact that the non-determinism in concurrent programs requires a more formal approach to programming. The transition from an informal approach, where students are able to rely on ad-hoc testing, to a more formal approach is difficult in and of itself, but it also highlights problems in students’ understanding of fundamental programming skills. For example, without a detailed enough understanding of scope, aliasing and references it is difficult to reason about what data is shared between threads. In light of these results, the remainder of this thesis describes ways of helping students learn concurrent programming. This is achieved by developing a program visualization tool, called Progvis, which is capable of visualizing the behavior of concurrent programs written in the C language. Progvis is unique in the sense that it focuses not only on concurrency, but also illustrates how concurrency interacts with the fundamental concepts that were found to be problematic. As such, it is able to give students a complete and accurate picture of the visualized program’s behavior. To further help students, Progvis also includes a model-checker that can automatically find concurrency issues, thereby helping students to easily see whether their reasoning about the program’s behavior was correct or not. The results suggest that the visualizations generated by Progvis have the potential to help students learn concurrent programming. A small pilot study showed that students who used Progvis were able to solve concurrency problems faster and arrived at better solutions compared to students who only used traditional tools. To evaluate long-term effects on learning, Progvis was also integrated into a course on concurrency and operating systems. Comparing the students’ performance on the final exam showed that the students who had used Progvis were more likely to correctly associate their synchronization with the associated data compared to students who had not used Progvis during the course. Even though no significant increase was observed in students’ overall performance, these results suggest that using Progvis does indeed have a positive impact on students’ learning. 

  This dissertation MIGHT be available in PDF-format. Check this page to see if it is available for download.