Published Sep 3, 2019

Episode 19: Concurrency Pt. 2

Explore the intricacies of concurrency with Alexander von Zitzewitz and Michael Scharf as they delve into thread management, concurrency patterns, and architectural considerations, revealing how these techniques can optimize system efficiency and reshape software design.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

Popular Clips

Episode Highlights

  • Thread Pools

    Thread pools are a crucial design pattern in concurrent programming, offering a solution to the high cost of thread creation. explains that instead of creating new threads, which are resource-intensive, a pool of threads can be maintained and reused as needed. This approach not only conserves resources but also enhances system efficiency by delegating tasks to idle threads within the pool 1. adds that once a thread completes its task, it should be returned to the pool for future use 2.

    Threads are very expensive to create. So a design pattern there is to have a pool of threads.

    ---

    This method ensures that the system remains responsive and capable of handling multiple tasks simultaneously.

       

    Thread Optimization

    Optimizing the number of threads is essential for maintaining system performance and responsiveness. suggests using separate threads for highly interactive system parts, such as user interfaces, to ensure they remain reactive 3. He also recommends separating control logic into distinct threads for easier maintenance. advises making thread pools and threading strategies configurable to adapt to changing hardware and application demands 4.

    I would always recommend to make thread pools configurable and to actually make this threading strategy configurable.

    ---

    This flexibility allows systems to adjust dynamically, optimizing resource usage and performance.

Related Episodes