os211

Top 10 List of Week 07

1. Race Conditions and How to Prevent Them (YouTube Video)

The animation in this video is something else. Not only that this video has good content, but the animations can also be quite entertaining as well. I really like how the guy from the video uses the animations to explain about race conditions. This way, we can have a visual representation of the system to better understand the topic. The explanations are also clear and easy to understand. This video also tells us a way to prevent a race condition by using the Dekker’s Algorithm.

2. Deadlock in Operating System (YouTube Video)

There are four conditions which must be true when there is a deadlock, those are: Mutual Exclusion, No Preemption, Hold and Wait, and Circular Wait. If one of the four is false, then a deadlock will never occur. This video will explain more in detail about those four conditions of a deadlock. The explanations are well delivered and easy to understand. The video also has pictures and diagrams to help us understand deadlocks better.

3. Deadlock Handling Methods (YouTube Video)

Based on this video, there are four ways to handle deadlocks, which are: Prevention, Avoidance, Detection and Recovery, and Ignorance. It turns out that popular operating systems, such as Windows and UNIX, ignore deadlocks. They ignore deadlocks because deadlocks are considered rare and are unlikely to happen. Even if they implement a way to handle deadlocks, the cost will compromise the speed. This video explains these handling methods well. The video also uses real life examples so that we can understand better.

4. Deadlock Ignorance in Operating System (Article)

Extra links
A QnA article that also talks about the same question.
Why do modern operating systems pretend that deadlocks do not occur? (QnA Article)

I was still wondering on why popular operating systems, such as Windows and UNIX, ignores deadlocks. So, I search for more information. It turns out that one of the reasons why deadlocks are ignored is because it is very unlikely to happen. The method to handle deadlocks are not simple, thus increasing complexity. It is better for the developers to handle system failure, crashes, and other stuffs that are most likely to happen rather than handling deadlocks. Other than that, deadlock detection also consumes a hefty amount of resources which can starve your system. And the deadlock is very unlikely to happen. So, you will be wasting a lot of resources for something that is probably not going to happen. Mubazir.

5. Deadlock Prevention (YouTube Video)

One of the ways to handle deadlocks is Prevention. This video will explain prevention methods to prevent deadlocks. What I like about this video is that it gives prevention methods for all the deadlock conditions. So, we can have a better insight on how to make each single deadlock condition false in order to prevent deadlocks. Moreover, the video also has great explanation and uses pictures and diagrams to help us understand deadlock preventions better.

6. Deadlock Avoidance | Banker’s Algorithm (YouTube Video)

Extra links
Part two of the video.
Deadlock Avoidance | Banker’s Algorithm (Part 2)

Another way to handle deadlocks is Avoidance. Banker’s Algorithm is a method that is used to avoid deadlocks. From what I learned from the video, Banker’s Algorithm will assess the resources each process needs. It will then create a sequence of processes that is safe to execute. When there are not sequences that can be generated, then a deadlock will certainly occur. The explanation of this video is detailed step-by-steps so that you will not miss a single detail on how the algorithm works.

7. Database DeadLock Explained by Example (YouTube Video)

This is the real life example of the occurrences of a deadlock. The video gives us an example of a deadlock that occur in a PostgreSQL database. It feels good to actually see a real life deadlock in action. It can give you more insight about what does a deadlock looks like. The way that the guy from the video explain is easy to follow and understand. Moreover, we are also taking the Databases Course, who knows, this example might be helpful in the future.

8. DeadLock With Example In C++ (YouTube Video)

This is more of a specific example of a deadlock in programming. He shows us an example program that will produce a deadlock. Surprisingly, even though the program is designed to produce deadlocks, the deadlock did not occur. This is because deadlocks are very unlikely to happen (more about this in the other links). He also shows us how to prevent those deadlocks by writing proper programs that will not produce deadlocks. His explanation is also easy to follow and understand, which is good.

9. Dining Philosophers Problem (YouTube Video)

This famous problem that is often used when explaining about deadlocks is very helpful when you are learning about deadlocks. A little fun fact, the person who formulated this problem is the same person who created the Semaphore solution, as well as the Dijkstra Algorithm, Edsger W. Dijkstra. This problem pictures the example of deadlocking, the condition where every philosopher on the table is doing nothing, only thinking. Therefore I am nothing is accomplished. Similar to when a process is waiting for another process which is waiting for the process. Nothing is accomplished. This video explains this problem more in detail. The video also provides picture so that we can have a better picture of the problem.

10. Peterson’s Algorithm Easily Explained (YouTube Video)

Peterson’s Algorithm is also one of the ways to prevent deadlocks. It uses two types of signals, the turn signal and the flag signal. More about the Peterson’s Algorithm in this video, I really like this video because the guy from the video uses real life examples to explain about Peterson’s Algorithm. This way, we can have a better perspective on how the algorithm works.