Published Sep 3, 2019

Episode 12: Concurrency Pt. 1

Discover the fundamentals of concurrency as Alex Robson and Michael Scharf delve into Java's approach to simultaneous task execution, examine key features like synchronizing keywords, and tackle challenges such as race conditions and deadlocks, with insights into enhancing performance and scalability for future discussions.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

Popular Clips

Episode Highlights

  • Shared Resources

    Managing shared resources in concurrent programming is a critical challenge. explains that shared resources can be anything from memory locations to databases, and accessing them safely is essential to avoid issues like race conditions and corrupted data 1. A critical section is a code segment that can only be executed by one thread at a time, ensuring consistency. describes semaphores and mutexes as tools to manage access to these sections, preventing simultaneous access by multiple threads 1.

    A race condition happens when you have inconsistent data because of overlapping, parallel executing threads, manipulating the same shared resources, and leaving it in an inconsistent state.

    ---

    adds that Heisenberg bugs, where debugging changes the execution speed and hides the problem, further complicate concurrency 1.

       

    Concurrency Problems

    Concurrency issues like deadlocks and race conditions are prevalent in software systems. highlights deadlocks, which occur when threads are unable to proceed because they are waiting on each other to release locks 2. This results in a frozen state where the program cannot move forward or backward. notes that concurrency is embedded in many layers of technology, from CPUs with multiple cores to operating systems and web servers, making it a ubiquitous challenge 2.

    You have concurrency in all the layers or all the layers you have to deal with offer some kind of concurrency.

    ---

    Scharf identifies three key domains requiring intense concurrency management: infrastructure development, embedded applications, and databases, each with unique challenges 2.

Related Episodes