Тёмный

Dining Philosophers Problem with Solution 

Gary Explains
Подписаться 314 тыс.
Просмотров 79 тыс.
50% 1

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 119   
@nimrodlevy
@nimrodlevy 6 лет назад
Lol my professor tried to explain that for 40 minutes and couldnt... In 8 min youve done a much better job! Many many thanks!
@christinboicourt9053
@christinboicourt9053 3 года назад
For real!
@jazz4398
@jazz4398 2 года назад
My professors sucked too
@t_rm2119
@t_rm2119 2 года назад
mine didn't even try explaining lol just showed the code and told us to it by ourselves
@aymanmakhoukhi3591
@aymanmakhoukhi3591 2 года назад
my professor tried to do so for 2 hours and now I'm here trying to understand. thank you sir! that was crystal clear
@NotQuiteFirst
@NotQuiteFirst 6 лет назад
Good explanation... except that it was illustrated with pizzas which require 0 forks to eat lol
@GaryExplains
@GaryExplains 6 лет назад
LOL
@evanskeletsophuswane2039
@evanskeletsophuswane2039 5 лет назад
hahaha
@berni2905
@berni2905 4 года назад
And if you decide to use a fork nevertheless, you still need a knife.
@Amy-tw3zh
@Amy-tw3zh 4 года назад
Unless you're Italian!
@FreakingRockstar101
@FreakingRockstar101 4 года назад
The original is bowl of noodles and chopsticks lol...I was thinking the same thing...this problem makes no sense in reality
@Maksum1ua
@Maksum1ua 5 лет назад
3 lectures x 1.5 hour = your 8-minute video. Thank you!
@Soumyadip_Pal
@Soumyadip_Pal 6 лет назад
I was literally learning "Dining Philosopher's Problem" for my upcoming semester until I saw this notification!! You literally read my mind, professor....
@notaekbitcoin6314
@notaekbitcoin6314 6 лет назад
Soumyadip Pal lol
@ummm74
@ummm74 7 месяцев назад
@@notaekbitcoin6314
@Mooooooof
@Mooooooof 6 лет назад
I’ve covered this recently on my course but you’re still a godsend to anyone who studies CS or has an interest in it. I’m glad you have your own channel, had been saying it for a long time on android authority
@fuzz33594
@fuzz33594 6 лет назад
Professor Sims - another excellent explanation and whilst I am tempted to continue heaping praise on you I find myself overwhelmed with a desire to eat.
@GaryExplains
@GaryExplains 6 лет назад
LOL. Pizza to go!
@niharikapatil902
@niharikapatil902 6 лет назад
loved how you started the video right to the point ! Your computer is already running multiple processes at the same time. Loved it! catches attention and you immediately start to think!
@ToPFeE1234
@ToPFeE1234 3 года назад
I just learning this problem in class, you really help me, bro.
@adamking1330
@adamking1330 2 года назад
Got an exam on this in 11 minutes. Never understood it until now. Cheers!
@tomjosi742
@tomjosi742 6 лет назад
Wow, you really just made it so easy. So easy to follow you and loved your way of explaining your ideas easily and in short time. Thumbs up professor.
@ilhemwalker9145
@ilhemwalker9145 2 года назад
exactlyy he's awesome
@michaeloffordum6438
@michaeloffordum6438 2 года назад
This really helped me a lot cause we are currently at this problem in one of my courses this semester. Thanks a lot 👍
@napalm5
@napalm5 2 года назад
You explained this really well, great presentation
@rpsgrayfox
@rpsgrayfox 6 лет назад
Thanks Gary! It's a very good visualization of some of the complex systems cpus have to work with. I now understand a little better what modifying the cpu scheduler on a custom kernel does in Android 😊
@Jurkox26
@Jurkox26 2 года назад
It's actually a task for OS.
@Rajorsi
@Rajorsi 6 лет назад
Too late!! My OS exam was a week ago. lol
@SamiurRahmanTonmoy
@SamiurRahmanTonmoy 6 лет назад
Heard about it somewhere a long time ago but didn't know it has a fancy title... Good one!
@DavidDeLuge
@DavidDeLuge 6 лет назад
Nicely explained. Love this channel!
@reggiebush49
@reggiebush49 5 лет назад
How did this guy just explain in 8 minutes what my Operating Systems professor has been trying to explain for weeks?
@katierobinson5464
@katierobinson5464 5 лет назад
Thanks for making a couple of the philosophers women! I noticed and appreciated it lol
@sandralloyd3754
@sandralloyd3754 3 года назад
Agreed! Just a small gesture like including diverse faces in an example goes a long way to help underrepresented folks feel welcome! Thank you, @Gary Explains !
@TMNIARB3A
@TMNIARB3A 3 месяца назад
great explanation sir... thank you sm!
@bennyabramovici6718
@bennyabramovici6718 4 года назад
If I may add about what atomic means:As the ancient Greeks believed that atoms are fundamental building blocks and can not be further broken into smaller components. In Computer science, Atomic operation must be completed from start till finish. For example if the locking operation is 5 lines of code then they must all be completed from start till finish. there my be no interups accepted, context switching by the scheduler or anything till the whole thing is complete. Thats why atomic operations have to be very short.
@1MarkKeller
@1MarkKeller 6 лет назад
*GARY!!!* *Good Afternoon Professor!!!* Still at work ... Sigh!
@GaryExplains
@GaryExplains 6 лет назад
MARK!!! Stay strong! :-)
@Ryuseigan
@Ryuseigan 6 лет назад
Nicely explained Thanks for explaining deadlock
@golsaemdadi
@golsaemdadi 6 лет назад
Very clear and good description, Thank YOu
@khurshidernazarov809
@khurshidernazarov809 4 года назад
Thank you very much, this is a really nice way to explain threads and concurrent processes.
@MeenuMathew
@MeenuMathew 5 лет назад
Really helpful ...You explained it in excellent way...Thank You So much...
@gakwayadavid1558
@gakwayadavid1558 6 лет назад
Well Explained!
@RotroBreakteve
@RotroBreakteve 5 лет назад
Thanks for explaining this Gary :)
@niloofar156
@niloofar156 5 лет назад
Very clear, very helpful, thank you 🌹🌹
@Mr12Rishabh
@Mr12Rishabh 6 лет назад
i am studying engineering , and tomorrow i have an exam of Operating Systems. The timing of this video is lovely
@blessinggandi3762
@blessinggandi3762 Год назад
Perfect explanation thank you....very helpful
@INT_MAX
@INT_MAX 6 лет назад
Great explanation, but I've never seen someone eat a meal with two forks. Seen plenty of people eat a meal with two chopsticks, however, I've never seen someone eat a meal with one chopstick. Maybe chopsticks are more appropriate for this illustration?
@GaryExplains
@GaryExplains 6 лет назад
LOL. I have never met a group of philosophers who when dining didn't have enough cutlery in the first place! I don't think the type of cutlery used is really the issue here!
@katherinelee5247
@katherinelee5247 5 лет назад
Really thanks for your explanation. Love it so muchhh. Hope you can do more videos about cs.
@aboodsaymeh13
@aboodsaymeh13 6 лет назад
I didn't know there was something called "dining philosophers problem" so I literally thought you were going to talk about dining philosophers...
@GaryExplains
@GaryExplains 6 лет назад
LOL
@indranilbhattacharji
@indranilbhattacharji 6 лет назад
Loved it sir!!
@ChinmayBS
@ChinmayBS 3 года назад
Thank you good explanation
@venkataravieluri9625
@venkataravieluri9625 6 лет назад
Very nicely explained and informative.
@alenkruth
@alenkruth 6 лет назад
Nice explainations sir!
@BatoulQ0182
@BatoulQ0182 4 года назад
omg whyy did I see this just now, I was trying to understand it for a month, and here I am understanding it in 8 mins ahahaha. thank you Garyyyy
@GaryExplains
@GaryExplains 4 года назад
Glad it helped!
@BatoulQ0182
@BatoulQ0182 4 года назад
Gary Explains 👌🏼👌🏼
@uttamchandra9726
@uttamchandra9726 6 лет назад
Good evening again professor...
@GaryExplains
@GaryExplains 6 лет назад
Two uploads today!!! :-)
@uttamchandra9726
@uttamchandra9726 6 лет назад
Ya I know, already watched that sir!!!
@oykuercin7987
@oykuercin7987 6 лет назад
Perfect explanation, thanks :)
@zeynepsedabirinci1409
@zeynepsedabirinci1409 6 лет назад
kind comment öykü, I wish you a good luck in midterm
@oykuercin7987
@oykuercin7987 6 лет назад
@@zeynepsedabirinci1409 hahahahhahahahahha you too
@ameydatar8078
@ameydatar8078 6 лет назад
Very nicely explained👍🏻 big thums up. Also can you please continue with your Python tutorials? Along with these OS concepts
@aishahrosdee6169
@aishahrosdee6169 3 года назад
thank you Gary this helps a lot!!
@DavidGarcia-pm4qj
@DavidGarcia-pm4qj 5 лет назад
You have described the request as a polling mechanism but it’s more of a queuing mechanism handled by the scheduler isn’t it? Maybe the waiter should write down the request.
@GaryExplains
@GaryExplains 5 лет назад
In which part am I describing as a polling mechanism, in the description of the problem or the solution? If it is the former, then that is the whole point there is no scheduler nor is there a queue. Such things form part of possible solutions.
@DavidGarcia-pm4qj
@DavidGarcia-pm4qj 5 лет назад
Gary Explains True. This is a great explanation either way.
@AnshumanKumar007
@AnshumanKumar007 6 лет назад
Part of my syllabus this sem :)
@rubencristobal655
@rubencristobal655 5 лет назад
Great explanation, thanks
@bs5am
@bs5am 2 года назад
Gary, I love you!
@natikrak
@natikrak 4 года назад
Thank you, thank you very much! You explained it very good! English is not my native language. It would be great if you could add some key words (few titles of your speech) so it would be easier:) have a nice day!
@haoz5259
@haoz5259 6 лет назад
like! Professor, could u please explain how the I/O channel and DMA works??
@sergiip619
@sergiip619 5 лет назад
good explanation, interesting problem. but eating from the same fork is kinda gross
@ZamanSiddiqui
@ZamanSiddiqui 6 лет назад
*GARY!* *Good evening, Professor!*
@GaryExplains
@GaryExplains 6 лет назад
ZAMAN!!!
@RahulAgarwal97
@RahulAgarwal97 6 лет назад
Sir, you have presented a simple solution for beginners. But in real life system the requests are random and concurrent. How would the 'waiter' here deal with random requests? Also u have provided a solution that is not starvation free as the philosopher lets down the fork is he doesn't get the second one. In a real world situation, there might be a very resource hungry process that might run for a long time. In such a scenario the other process or philosopher might starve to death. Is there a concurrent solution without essentially using locks? (Maybe using semaphores or monitors). I know this is way beyond the limits of youtube and the type of videos you do, but would be great if you coukd answer or refer me to some place where i can find answer. ( I have a course on Parallel and Concurrent programming running)
@GaryExplains
@GaryExplains 6 лет назад
It doesn't matter if the requests are random and concurrent. I was presenting the requests in order to demonstrate what would happen, but the principle is still the same. As for resource hungry processes that is beyond the scope of the Dining Philosophers illustration, as here the main point is how to avoid deadlock. Having said that I did hint at the problem of the 5th philosopher not getting a shot at asking for the forks. There are various different solutions to this, one of which is to assign the requests for forks with a priority. Dijkstra suggested a solution that doesn't use locks called the "Resource hierarchy solution."
@sirishtadepalli4363
@sirishtadepalli4363 10 месяцев назад
Thank you.
@venkataravieluri9625
@venkataravieluri9625 6 лет назад
Any you make videos on semaphores and mutex.
@fazalkhan8515
@fazalkhan8515 3 года назад
Love u..grt explanation
@danicruz226
@danicruz226 Год назад
My question is, how does the waiter knows who is eating or not
@tomkruger9869
@tomkruger9869 6 лет назад
Thank you !
@MrGyges
@MrGyges 6 лет назад
Thanks Gary, excellent stuff. Er, I’m on a diet, so eggheads, eat away
@e1234-b9l
@e1234-b9l 6 лет назад
Interesting, but it does not seem the waiter solves the problem. Instead of all picking up the left fork at the same time, now they will all be asking the waiter at the same time for permission and the 5 concurrent requests will cause a different lock.
@GaryExplains
@GaryExplains 6 лет назад
I understand why you say that, but no. As I said towards the end of the video the locking mechanism is atomic, which means that only one philosopher can be granted the lock and allowed to pickup forks. There is a slightly deeper level which I didn't discuss which is what happens when a philosopher doesn't get a lock, but it is enough to say (at this level) that deadlock doesn't occur.
@e1234-b9l
@e1234-b9l 6 лет назад
I see what you mean, but I’m talking about the problem in general.. The monitor giving locks does not seem to solve anything because if requests keep colliding with each other he will not have received a request to give a lock to. Seems like you would need some kind of randomly generated wait period before retry
@GaryExplains
@GaryExplains 6 лет назад
They can't collide, it is a queue.
@malgailany
@malgailany 6 лет назад
This locking mechanism looks similar to semaphore in RTOS.
@GaryExplains
@GaryExplains 6 лет назад
Yes that is right, there are different types of locks including mutexes, semaphores and critical sections.
@jakweed
@jakweed Год назад
This was great
@vinayaktyagi8773
@vinayaktyagi8773 3 года назад
This process contradict with google docs and Github where multiple user can edit it simultaneously. Can u plzzz how these process works ???
@GaryExplains
@GaryExplains 3 года назад
No, contradiction. They are two different problems. You don't need to exclusively lock a document.
@Pages_Perfected
@Pages_Perfected 2 года назад
ty
@gillo9070
@gillo9070 6 лет назад
Hi professor, where can i get a « lock » for my girlfriend please? 🧐
@gk26071983
@gk26071983 6 лет назад
impressive
@arunwarrier1545
@arunwarrier1545 2 года назад
hey great video. but fam y u got forks wid a pizza. whats wrong xD
@RootkitStudios
@RootkitStudios 6 лет назад
Change the word "problem" to "paradox" in the title and you'll have a viral. Trust me.
@biggywan9765
@biggywan9765 3 года назад
Dude I came here to see what philosophers ate at dinner
@carlomorischi3435
@carlomorischi3435 6 лет назад
I’m watching this on a TABLET not smartphone nor laptop
@GaryExplains
@GaryExplains 6 лет назад
Congratulations.
@marufasatullaev1436
@marufasatullaev1436 2 года назад
Объяснение на Сшку, вы не проходите префайнал.
@vgamesx1
@vgamesx1 6 лет назад
Solution, provide double the forks, who wants to share silverware?
@_Amilio_
@_Amilio_ 3 года назад
Chinese food and chopsticks would work better in this analogy
@AAYMF
@AAYMF 6 лет назад
👍
@shuaib3788
@shuaib3788 2 года назад
Cheers to 8 minutes !
@iBangGOODMusic
@iBangGOODMusic 2 года назад
I would just eat with my hands ✋️ 😩
@leticiaunisesky4852
@leticiaunisesky4852 2 года назад
비디오의 의미를 말해 줄 수 있니
@havenbastion
@havenbastion 4 года назад
If they can't figure out how to collaborate sufficient to eat, they're pretty bad philosopers.
@edington6302
@edington6302 Год назад
In Africa, we can just eat with our hands and do away with the forks.
@kennethholvoet1178
@kennethholvoet1178 4 года назад
Good video, but explaining this with chopsticks makes much more sense because you acutally need two of them to eat. Have to replace the pizza with something asian of course :-)
@xscout4lifex
@xscout4lifex 3 года назад
little does Gary know we have processors up to 64 cores in 2021, that's a lot of pizza
@GaryExplains
@GaryExplains 3 года назад
"little does Gary know we have processors up to 64 cores"... eh?
@joerogan3079
@joerogan3079 Год назад
*MY PROFESSOR COULDN'T EXPLAIN SOMETHING SO SIMPLE* 🤦‍♂️
Далее
What is a semaphore? How do they work? (Example in C)
13:27
Мои РОДИТЕЛИ - БОТАНЫ !
31:36
Просмотров 487 тыс.
How Many Twins Can You Spot?
00:17
Просмотров 23 млн
Multitasking vs Multithreading vs Multiprocessing
10:30
W7 L1 Dining Philosophers Problem
21:26
Просмотров 49 тыс.
Has Generative AI Already Peaked? - Computerphile
12:48