Published Sep 3, 2019

SE-Radio Episode 348 Riccardo Terrell on Concurrency

Join Riccardo Terrell as he delves into the complexities of concurrency in programming, exploring debugging techniques, concurrent design patterns, and the benefits of functional programming. Discover how to navigate multithreaded applications and achieve efficient code execution by using advanced strategies and asynchronous methodologies.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

Popular Clips

Episode Highlights

  • Immutability

    Immutability plays a crucial role in enhancing the safety of concurrent programming by eliminating the risks associated with shared state corruption. explains that immutability ensures that once a value is assigned, it remains unchanged, thus allowing multiple threads to access it without conflicts 1. This approach is increasingly embraced by modern programming languages like Go and Rust, which introduce immutable structures by default, contrasting with traditional languages such as C and Java 1.

    Now they're more and more introducing this concept, the language, because they realize that the best way to solve this kind of problem is from the roof, removing completely what could be the source of the problem, which is a mutable state.

    ---

    Terrell emphasizes that while adopting immutability may initially challenge developers accustomed to imperative programming, the long-term benefits in concurrency are significant 1.

       

    Transparency

    Referential transparency is a key concept in functional programming that facilitates concurrency by ensuring that functions are free of side effects. highlights that this property allows functions to be executed in any order without affecting the outcome, making them ideal for parallel execution 2. This characteristic not only aids in structuring programs for concurrency but also enables caching of function outputs, as the results remain consistent for the same inputs 2.

    Functional programming doesn't have side effects and therefore you could take set functions and run them concurrent because they will not interfere with each other anyway because there are no side effects, right?

    ---

    Terrell compares this to breaking down complex problems into smaller, independent tasks that can be solved concurrently, akin to the principles of functional programming 2.

Related Episodes