1 | % ====================================================================== |
---|
2 | % ====================================================================== |
---|
3 | \chapter{Introduction}\label{s:intro} |
---|
4 | % ====================================================================== |
---|
5 | % ====================================================================== |
---|
6 | |
---|
7 | Concurrent programs are the wild west of programming because determinism and simple ordering of program operations go out the window. |
---|
8 | To seize the reins and write performant and safe concurrent code, high-level concurrent-language features are needed. |
---|
9 | Like any other craftsmen, programmers are only as good as their tools, and concurrent tooling and features are no exception. |
---|
10 | |
---|
11 | This thesis presents a suite of high-level concurrent-language features implemented in the new programming-language \CFA. |
---|
12 | These features aim to improve the performance of concurrent programs, aid in writing safe programs, and assist user productivity by improving the ease of concurrent programming. |
---|
13 | The groundwork for concurrent features in \CFA was implemented by Thierry Delisle~\cite{Delisle18}, who contributed the threading system, coroutines, monitors and other tools. |
---|
14 | This thesis builds on top of that foundation by providing a suite of high-level concurrent features. |
---|
15 | The features include a @mutex@ statement, channels, a @waituntil@ statement, and an actor system. |
---|
16 | All of these features exist in other programming languages in some shape or form, however this thesis extends the original ideas by improving performance, productivity, and safety. |
---|
17 | |
---|
18 | |
---|
19 | The first chapter of this thesis aims to familiarize the reader with the language \CFA. |
---|
20 | In this chapter, syntax and features of the \CFA language that appear in this work are discussed The next chapter briefly discusses prior concurrency work in \CFA and how this work builds on top of existing features. |
---|
21 | The remaining chapters each introduce a concurrent language feature, discuss prior related work, and present contributions which are then benchmarked against other languages and systems. |
---|
22 | The first of these chapters discusses the @mutex@ statement, a language feature that improves ease of use and safety of lock usage. |
---|
23 | The @mutex@ statement is compared both in terms of safety and performance with similar tools in \CC and Java. |
---|
24 | The following chapter discusses channels, a message passing concurrency primitive that provides an avenue for safe synchronous and asynchronous communication across threads. |
---|
25 | Channels in \CFA are compared to Go, which popularized the use of channels in modern concurrent programs. |
---|
26 | The following chapter discusses the \CFA actor system. |
---|
27 | The \CFA actor system is a close cousin of channels, as it also belongs to the message passing paradigm of concurrency. |
---|
28 | However, the actor system provides a great degree of abstraction and ease of scalability, making it useful for a different range of problems than channels. |
---|
29 | The actor system in \CFA is compared with a variety of other systems on a suite of benchmarks, where it achieves significant performance gains over other systems due to its design. |
---|
30 | The final chapter discusses the \CFA @waituntil@ statement which provides the ability to synchronize while waiting for a resource, such as acquiring a lock, accessing a future, or writing to a channel. |
---|
31 | The @waituntil@ statement presented provides greater flexibility and expressibility than similar features in other languages. |
---|
32 | All in all, the features presented aim to fill in gaps in the current \CFA concurrent language support, and enable users to write a wider range of complex concurrent programs with ease. |
---|