From the course: IoT Foundations: Operating Systems Fundamentals
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Deadlock
From the course: IoT Foundations: Operating Systems Fundamentals
Deadlock
- [Instructor] One issue in concurrent task execution is deadlock. A deadlock is a situation where a group of tasks are permanently blocked, each waiting for a resource held by another task in a group. In other words, in a deadlock situation, multiple tasks are each waiting for the others taking action resulting in a stand still. Deadlocks can arise when inter-task mechanisms are incorrectly used to access resources shared between the tasks. They can also occur within a single task under certain conditions. Let's look at a typical scenario in which a deadlock occurs. Suppose we have signals S1 and S2, and the resources R1 and R2, which are held by Task 1 and Task 2 respectively. Now, Task 2 tries to access resource R1, which is held by Task 1, but it first needs to receive signal S1 from Task 1. Meanwhile, Task 1 attempts to access resource R2 held by Task 2, but it requires signals S2 from Task 2. Since Task 2 never receives signals S1, it enters a blocked state and the same happens…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.