No video

Dining Philosophers Solution using Monitors

  Рет қаралды 108,118

Neso Academy

Neso Academy

Күн бұрын

Operating System: Monitors
Topics discussed:
1. A Solution to the Dining Philosophers Problem using Monitors.
Follow Neso Academy on Instagram: @nesoacademy (bit.ly/2XP63OE)
Follow me on Instagram: @jaiz_itech (bit.ly/2M3xyOa)
Contribute: www.nesoacadem...
Memberships: bit.ly/2U7YSPI
Books: www.nesoacadem...
Website ► www.nesoacadem...
Forum ► forum.nesoacad...
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#OperatingSystemByNeso #OperatingSystem #ProcessSynchronization #Monitors

Пікірлер: 35
@Lucy92735
@Lucy92735 4 ай бұрын
Thank you very much, you guys have been our constant support to pass my exams every semester!! Love you Neso Academy
@FarmanOfficial777
@FarmanOfficial777 2 жыл бұрын
you are a lifesaver...in the world of operating system
@keshavchander2705
@keshavchander2705 3 жыл бұрын
You are superb teacher 👍👍👍 You make me motivated to complete that very big book like galvin 😁😁 ty so much
@sreelakshmik35
@sreelakshmik35 Ай бұрын
Thank you. Well explained
@selviarora3093
@selviarora3093 Жыл бұрын
Thank you so much for the step by step explanation
@sagarguggari2544
@sagarguggari2544 Ай бұрын
Watching one day before exam
@bhavaniraja5618
@bhavaniraja5618 Жыл бұрын
Very clear explanation
@sanathkumar6526
@sanathkumar6526 Жыл бұрын
Shouldn't putdown(i); come after test(i); in pickup function? Cus in this logic nothing is calling the putdown function
@anisksouri6905
@anisksouri6905 8 ай бұрын
you will use those functions in your main code then you can call each functions however u need
@eyepatch8430
@eyepatch8430 4 ай бұрын
Bro this is pseudo code those are just functions
@nehapol9862
@nehapol9862 Жыл бұрын
great explaination
@vkatasonov
@vkatasonov 9 ай бұрын
Thx for a video. One question: will that solution let us make all of philosophers eat in the correct time? I mean if simultaneously odd and even ones can eat not to die?
@farahmohamed2104
@farahmohamed2104 9 ай бұрын
well done
@deekshabhat5194
@deekshabhat5194 11 ай бұрын
thnk u
@sukriti9702
@sukriti9702 3 жыл бұрын
plz complete data structure playlist
@surajsuryawanshi7835
@surajsuryawanshi7835 2 жыл бұрын
agree
@viswanadareddyindupuru5831
@viswanadareddyindupuru5831 2 жыл бұрын
Nice Explanation Great Work
@bronwyndrummer8326
@bronwyndrummer8326 Жыл бұрын
How does the putdown function work when testing the next left and right philosophers? The test function requires that the current philosopher is hungry but we never got to change the state of that current philosopher to hungry?
@bronwyndrummer8326
@bronwyndrummer8326 Жыл бұрын
We only got to change the current philosopher's state to hungry in the pickup function, so how can the current philosopher be hungry in the putdown function?
@SajidAli-ub6th
@SajidAli-ub6th Жыл бұрын
@@bronwyndrummer8326 Let's say we are calling putdown function for philosopher 1; we are setting its state back to thinking. Fine so far? Now since it is putting its chopsticks his left and right philosopher can eat now, we are calling test function on them. For ex, when we call test ((i+4)%5), the parameter of the test function is index of right philosopher, not the current one. Is your confusion because we are checking the state of i as hungry in the test function? if yes, please check the basic function concepts. When executing the test function, i is actually the right philosopher's index, not the current one.
@bronwyndrummer8326
@bronwyndrummer8326 Жыл бұрын
​@@SajidAli-ub6th Yes I am a tiny bit confused because let's say Philosopher 1 initially wanted to eat. So his state is set to hungry when he picks up the chopsticks. When he is done he will put them down and the putdown function will test the philosopher to the right of him. The test function requires him (the philosopher that was on the right) to be hungry. But in the putdown function did not allow him to change his state to hungry as of yet. That only happens in the pickup function? So to my understanding that test function would evaluate to false for this philosopher because he never got to change his state to hungry yet?
@lindadeng3149
@lindadeng3149 Жыл бұрын
@@bronwyndrummer8326 I have the same question. Also, I remember philosopher dinner only allows one philosopher to eat at a time, so if we test the left and the right both, will it result both of them can eat together?
@ScantaniouslyCombust
@ScantaniouslyCombust 2 жыл бұрын
The code makes sense, but I don't understand how and where initialization-code is run or the monitor is accessed?
@fritz6600
@fritz6600 2 жыл бұрын
Whenever a process (philosopher) wants to eat they would call the two functions (pickup and put down).
@physicslover6840
@physicslover6840 2 жыл бұрын
Initially assume all are hungry then it start clearly what code will do
@hamzafeghouli4297
@hamzafeghouli4297 2 жыл бұрын
you're awesome
@imranimmu4714
@imranimmu4714 2 жыл бұрын
awesomme
@AnonymousAnonymous-pz8iz
@AnonymousAnonymous-pz8iz 10 күн бұрын
Pls someone explain (i+1%5)
@iamright5818
@iamright5818 2 жыл бұрын
When will be putdown function called?
@thinktank3613
@thinktank3613 Жыл бұрын
After eating
@iennguyenphuong7687
@iennguyenphuong7687 2 жыл бұрын
I have main function
@surajsuryawanshi7835
@surajsuryawanshi7835 2 жыл бұрын
6.33 test function{ if( i==1 ) state[(i+4)]!=eating) and state[(i+1)%5]!=eating else if(i==4) state[(i+4)%5]!=eating) and state[(i+1)]!=eating else state[(i+4)%5]!=eating) and state[(i+1)%5]!=eating }
@L3Moody
@L3Moody Жыл бұрын
you have to remember that in an array, the first variable in the array is considered item 0 rather than item 1. meaning the array would have [0, 1, 2, 3, 4] therefor, the original solution is actually correct.
@jatinkumar6748
@jatinkumar6748 Жыл бұрын
This code is actually saying that only philosopher with i=1 can eat except other philosopher 0,2,3,4😂😂😂
@swarajya.55
@swarajya.55 3 жыл бұрын
First!
Process Synchronization - Problem 1
9:57
Neso Academy
Рет қаралды 72 М.
Monitors
13:46
Neso Academy
Рет қаралды 187 М.
Harley Quinn's plan for revenge!!!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 33 МЛН
Kids' Guide to Fire Safety: Essential Lessons #shorts
00:34
Fabiosa Animated
Рет қаралды 14 МЛН
Они так быстро убрались!
01:00
Аришнев
Рет қаралды 3,2 МЛН
BATCH 06: SAP S/4 HANA FICO: Regular Session 06
2:07:20
AJAY SAP FICO
Рет қаралды 24
Call By Value & Call By Reference in C
8:34
Neso Academy
Рет қаралды 1,3 МЛН
Keys in RDBMS
22:49
Neso Academy
Рет қаралды 313 М.
Semaphores
22:51
Neso Academy
Рет қаралды 457 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 641 М.
GCD - Euclidean Algorithm (Method 1)
14:38
Neso Academy
Рет қаралды 531 М.
Ishita Kishore AIR 1 IAS Topper | UPSC Result 2022 | Mock Interview | Vajirao & Reddy Institute
23:44