Concurrency patterns in SCOOP
Master Thesis, March 2014 — September 2014
Author: Roman Schmocker
- Project Plan
- Final Report
SCOOP mechanism in Eiffel is a language extension for concurrency. Many important concurrency problems, such as the Dining Philosophers, can be solved in a simple and elegant way. In practice programmers have learned to avoid tricky concurrency issues in most cases. In order to make use of modern multi-core machines, most applications use thread-safe data structures and some well-known patterns, like a worker pool.
In the case of Eiffel primitive operations like individual method calls are thread-safe thanks to SCOOP. There is little experience in constructing higher-level concurrency patterns however. As a consequence, whenever a programmer wants to use a pattern to solve a specific problem he or she needs to figure out a way to do it in SCOOP.
The goal of the project is therefore to determine how some interesting concurrency problems, for which a well-known pattern exists in other languages, can be solved in Eiffel with the SCOOP extension.An example is the idea that when two threads proceed concurrently and need to update each other, as in the case of a user interface thread and a downloading thread, where the UI should be updated regularly to show the progress of the download. The standard solution is for the download process to trigger a repaint operation in the UI thread and to store the progress value in a synchronized shared object. With SCOOP however it is useful to introduce a third processor with which they both communicate to avoid undue waiting or even deadlock.
The result of the previous analysis is a new set of SCOOP specifc patterns that each solve a typical concurrency problem. As a last step, those patterns should be turned into reusable library components.