All posts by Ian Stark

Lecture 15: The Rust Programming Language

Title slideThis final APL topic addresses programming for memory safety, and in particular the techniques used in the Rust language. Rust is a fairly recent language, designed for “safe systems programming”: providing low-level precise control for programmers, minimal execution overheads, and promises about correct use of memory and threads. In this short introductory lecture I covered the basics of Rust, and gave a few small indications of how its C-like appearance masks a quite substantial effort to do things differently.
Continue reading Lecture 15: The Rust Programming Language

Lecture 10: Some Other Approaches to Concurrency

Title slide

Today’s lecture set out some alternative approaches for managing concurrency in programming languages: asynchronous message-passing Actors and the always-upbeat optimistic concurrency of Software Transactional Memory. These are two examples from a wide range of mechanisms in use across many programming languages and applications domains, all of which seek to balance the key concurrency requirements of separation to prevent inconsistency and co-operation to allow interaction.
Continue reading Lecture 10: Some Other Approaches to Concurrency

Lecture 9: Concurrency Abstractions

Title slideIn this lecture I reviewed the built-in Java concurrency primitives, the challenges of writing thread-safe code, and introduced some patterns that can help: immutability, synchronization wrappers, and control abstractions like producer/consumer. More high-level currency abstractions, such as those in the java.util.concurrent package, support programming that is not only thread-safe but takes explicit advantage of concurrency to increase performance and responsiveness. Finally, I walked through some intentionally racy code in the Java String library.
Continue reading Lecture 9: Concurrency Abstractions

Lecture 7: Concurrency

Title slideMoving on from type systems, today’s lecture started a look at programming for concurrency: why you might want — or need — to write concurrent code and some of the challenges in doing so. I also introduced some of the concurrency primitives in Java and how they are used, as well as telling a story about the Apollo Guidance Computer and the robustness of its concurrent event handling under input overload.
Continue reading Lecture 7: Concurrency