Тёмный
No video :(

Deadlock 3: Dining Philosophers 

Jacob Schrum
Подписаться 18 тыс.
Просмотров 47 тыс.
50% 1

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

 

4 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 33   
@ukaszsmigielski8648
@ukaszsmigielski8648 6 лет назад
More english videos on youtube about OSs and I would be happy
@shinreyzhang
@shinreyzhang 6 лет назад
Thank you so much, you have explained this problem very thoroughly
@disorder1111
@disorder1111 6 лет назад
Thanks for these videos. I have been studying by reading a chapter in the Stallings book first and then watching the corresponding video(s) on your channel. I wish you had a video for every subject!
@onaecO
@onaecO Год назад
beautiful !
@grantwilson6577
@grantwilson6577 7 лет назад
this leads to P4 leading to starvation as he eats less often. Thanks you for the video.
@MintFiend
@MintFiend 7 лет назад
Grant Wilson Could you explain why please?
@grantwilson6577
@grantwilson6577 7 лет назад
this is because P0 will always have priority over F0, therefore it it's not first come first serve. so P4 will eat less often then the rest leading to the thread being "starved". starved in the concurrent definition, not literally starved.
@MintFiend
@MintFiend 7 лет назад
But no philosopher has "priority", they just have a fork that they will go for first. In the same way that P0 will go for F0 first, P4 will also go for F0 first. It's true that in this way F0 is unique as it has two philosophers that will go for it first, whereas F1, 2, and 3 only each have one philosopher that will go for them first. No philosopher will go for F4 first. I can't figure out if all that means some philosophers may be starved vs others, or whether it all evens out in the end as all philosophers always need to acquire two forks to eat anyway. I'd appreciate it if someone could provide a definitive answer.
@JacobSchrum
@JacobSchrum 7 лет назад
If p4 is waiting to take f0 because p0 claimed it (or vice-versa), then it will be able to immediately take f0 as soon as the other philosopher is done because the semSignal command is an explicit invitation to take the newly released resource. There may be some small bias in who gets f0 first, but from that point onward, if demand for f0 is high, then the two philosophers will simply be taking turns, which is as fair as you can expect.
@GalacticEmpression
@GalacticEmpression 7 лет назад
You are correct- Thank you
@ahcenebelhadi955
@ahcenebelhadi955 2 года назад
Thanks for this simple solution!
@ValentinBaca
@ValentinBaca 7 лет назад
Thanks for the clear explanation!
@furb39692
@furb39692 5 лет назад
If you make fork = 5 and change code to have just one wait and signal where the wait decrements by two and the signal increments by 2 that would fix it as well.
@DaveJLin
@DaveJLin 4 года назад
Excellent explanation, thanks!
@paurushgargtube
@paurushgargtube 2 года назад
Thanks.
@ViniciuxMariano
@ViniciuxMariano 5 лет назад
awesome explanation
@rajkunal7628
@rajkunal7628 6 лет назад
Best explaination
@chandrashakerreddy3915
@chandrashakerreddy3915 6 лет назад
Thank you 🙏
@chrise202
@chrise202 6 лет назад
Elegant solution!
@DarkLambfromthesun
@DarkLambfromthesun 6 лет назад
Great video!
@pabliospark
@pabliospark 7 лет назад
well explained, thank you!
@learnwithdounia6946
@learnwithdounia6946 4 года назад
thanks for explanation ,have you a code in java or c of dining philosophers ?
@celsiusfahrenheit1176
@celsiusfahrenheit1176 4 года назад
Probably being philosopher they figure that two forks would allow them to shove more spaghetti down their pie holes, increasing concurrency.
@tarungupta5827
@tarungupta5827 6 лет назад
Nice!
@ethanphan6136
@ethanphan6136 7 лет назад
What if P3 eats so fast and also fast in grabbing the fork, will it also create deadlock? I'm just trying to consider all the edge cases.
@paolo2605
@paolo2605 7 лет назад
That is starvation not deadlock. But you are right, it is possible.
@shireeniqbal7399
@shireeniqbal7399 7 лет назад
perfect
@celsiusfahrenheit1176
@celsiusfahrenheit1176 4 года назад
Infinite supply of spaghetti, I'm hungry now lol
@shaydennaidoo4036
@shaydennaidoo4036 9 месяцев назад
prof g brought me here
@dougg1976
@dougg1976 6 лет назад
Philosophers need 2 forks to eat how inefficient! Get more forks
@dungleouet
@dungleouet 4 года назад
OMG
@poleomentaa
@poleomentaa 5 лет назад
while ( true ) { fork(); }
@Teslacoil33
@Teslacoil33 4 года назад
Fork bomb baby!
Далее
Dining Philosophers Problem with Solution
8:10
Просмотров 78 тыс.
Synchronization 1: Semaphores
16:34
Просмотров 91 тыс.
Throwing Swords From My Blue Cybertruck
00:32
Просмотров 10 млн
😱ЖИВОЙ Чехол на Айфон🤪
00:38
Просмотров 246 тыс.
Dining Philosopher problem (semaphore )
10:45
Просмотров 63 тыс.
Banker's Algorithm explained
10:02
Просмотров 154 тыс.
Lecture 1, unit 1: Introduction to Concurrency
12:03
Просмотров 72 тыс.
Every Type of Math Explained in 9 Minutes.
8:50
Просмотров 507 тыс.
W7 L1 Dining Philosophers Problem
21:26
Просмотров 48 тыс.
This is why Deep Learning is really weird.
2:06:38
Просмотров 385 тыс.
SAFE Multithreading with Mutex Locks
7:51
Просмотров 3,1 тыс.