Race Conditions and How to Prevent Them - A Look at Dekker's Algorithm

preview_player
Показать описание
When two programs both need access to some shared data, how do we ensure that they don’t try to manipulate the data at the same time? This is the mutual exclusion problem, and it’s often solved with hardware. But even without any special hardware, Dekker’s Algorithm offers a way to ensure that programs can only access the shared data one at a time. Here, we take a visual look at Dekker’s Algorithm: what’s the intuition behind it? How does it work? And why does it prevent race conditions?

0:00 Mutual Exclusion
2:24 Signaling
4:05 Dekker’s Algorithm

***

Рекомендации по теме
Комментарии
Автор

I have 20 years of development and still watching that kind of videos from time to time. Mostly to see how things are explained.
Yet, I realized that one of my software is not accounting for starvation of the slowest processes! And the even funnier thing is that I did implement process priority...So, one process can flag itself as being high priority to be guaranteed the next slot. And now that I think about it...I in fact inadvertently did indeed allow slower process to not be starved as they can enter in the queue while the fast process is executing.
And this is why watching entry level CS video IS still a good thing even for seniors ^^ Not only learning how to explain things, but also small reminder to think about some cases that can be overlooked.

programaths
Автор

Just wanted to drop a comment to say that this was such an elegant and well thought out explanation. I really liked how you started from first principles and built your way to the solution. Cheers! :)

williamwalcher
Автор

Mann....I really felt bad for those cute bots when they were stuck in a deadlock.😭😭😭

enlgn
Автор

Hello Brian, I am a Junior Student in CS major. I'm struggle a lot in university but your lectures inspire me a lot and help me keep going, especially CS50w. Hope you continue these great contents and get more success in the future.

aroundtheworld
Автор

This is exactly how you explain a concept. Not only do you show very beautifully designed visuals, but you actually start from scratch. Like you pretend you also dont know the concept and we are almost ‘learning’ together in a way.

Anyway, just came across your channel very recently and just kept watching one video after another. Hope to see you back soon

SuperDarmino
Автор

Great Explanation
I've never seen two programs that adorable.

_abdul
Автор

This is no doubt the best explanation of Dekker's algorithm I have ever seen. Amazing work !!!

rishabhrathi
Автор

Amazing explanation. I liked the part towards the end where you go over the subtleties of what makes the algorithm good

anamigator
Автор

You are doing amazing job to explain more algorithms in this same way I am sure your work will be recognized by everyone soon....Good luck:)

maheswaran
Автор

Love the explanations and animations! Great work on cs50 AI too

jamesdaus
Автор

I am programming two robots that need to enter a shared space but only one at a time and ended up implementing something like that but with a hard priority where the first indicator forbids the second. Very nice presentation!

stgram
Автор

Well this is a much more coherent explanation than my old professor, thanks!

bscorvin
Автор

Super clear explanation, your video really helped me understand the Critical Section better, thank you!

matteobecatti
Автор

The video is secretly teaching us how to count from 1 to 10.

danielyuan
Автор

We learned 2 concepts in this video. Thank you so much.
I am a software engineer who did not graduated from CS. Your videos are great!

hoangphamduc
Автор

how can someone come here and actually dislike this excellent amazing work bro!🔥

nigelkay
Автор

Literally had a program suffer from race conditions and this video really helped me fix it

bettercalldelta
Автор

This is what efficiently conveying an idea means.!
Developer, Take a bow !

saurabhsoni
Автор

The best explanation ever! I swear youtube is better than these lectures

ayaanahabel
Автор

I thought the solution would be using locks.

But I can see now that it may prevent slow process to use it as much as needed, thanks to your explanation.

Great videos!

victoriam