L-3.10: Practice Question on Binary Semaphore in Operating System

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

ความคิดเห็น •

  • @Lusid_yt
    @Lusid_yt 3 ปีที่แล้ว +189

    WOW, p10 is like that one friend that gets you into parties on New year's eve😂.

  • @anishanish9497
    @anishanish9497 9 หลายเดือนก่อน +2

    15:07 ,putting p10 out then making p10 enter again thus mutex=1 then making p2 enter then again putting p10 out then making p10 enter thus p3 in AND in this way making p4,p5,p6,p7,p8,p9 enter in CS and p10 also in CS thus in TOTAL processes which is in critical section is ==10

  • @rohitmahajan2111
    @rohitmahajan2111 4 ปีที่แล้ว +27

    Hello sir,
    You teach very well. You are helping so much students. Thanks a lot.❤

  • @mukularora4572
    @mukularora4572 4 ปีที่แล้ว +51

    Viewers, do not lose sight of the repeat keyword in the Process #10

  • @ShubhamGhuleCodes
    @ShubhamGhuleCodes 3 ปีที่แล้ว +33

    CORRECTION
    6:18 It is not necessary that the mutex value will become 1 because firstly it will check the suspended queue before incrementing the mutex value

    • @noobgameplay4801
      @noobgameplay4801 3 ปีที่แล้ว +7

      yeah, bro. I also noticed it. And I am a little bit confused now.

    • @akankshasharma7498
      @akankshasharma7498 3 ปีที่แล้ว +4

      But in that case suspended list IS empty

    • @anshikachoudhary9130
      @anshikachoudhary9130 3 ปีที่แล้ว +8

      @@akankshasharma7498 only P1 enter in the critical section and P2 to P9 are blocked in suspended list. so how suspended list can be empty when P10 is arriving?

    • @geekofia
      @geekofia 3 ปีที่แล้ว +23

      ​@@anshikachoudhary9130 The suspended list is always empty in this case: P1↓, P10↓, P2↓, P10↑, P3↓, P10↓, P4↓, P10↑, P4↓, P10↓, P5↓, P10↑, P6↓, P10↓, P7↓, P10↑, P8↓, P10↓, P9↓ (max P1 to P9 along with P10 can be in CS)

    • @swapnilm5805
      @swapnilm5805 3 ปีที่แล้ว +3

      @@anshikachoudhary9130right... it will be not empty ..instead of making value mutex=1, it will first check the suspend list and wake a process from suspend list if it is not empty and put it in cs
      so in this case p1 will successfully enter its cs ,and p2 to p9 will be in suspend list
      , when p10 will arrive it will wake p2..p2 will run up operation on exiting its cs and wake p3.. likewise p3 will wake p4 and so on ..so all process will be in cs

  • @shmvmedia-official
    @shmvmedia-official 5 ปีที่แล้ว +14

    Guru apke charan kaha 🙏🙏.. Thank u guru ji

  • @jyotigupta9885
    @jyotigupta9885 5 ปีที่แล้ว +14

    All the videos on operating systems are really helpful in understanding the various topics.. Thank you so much Sir.

  • @ayush_jaka20
    @ayush_jaka20 2 ปีที่แล้ว +12

    In case 3 also when there is a P(mutex) after CS of P10 , we will be having max no of process inside CS = 10, as in this case also we can call P10 process again & again to push all the Pi processes inside the CS.

    • @tusharkhandelwal3843
      @tusharkhandelwal3843 2 ปีที่แล้ว +3

      exactly that's what I also thought bcoz there is no limit to which we can add/remove P10 like case 2 so max number of processes at a time can be 10.

    • @cricketwala937
      @cricketwala937 ปีที่แล้ว +1

      i agree

    • @ron.x_sensei
      @ron.x_sensei ปีที่แล้ว +1

      Yaa I also have the same doubt

    • @mukulbikaspahari6583
      @mukulbikaspahari6583 2 หลายเดือนก่อน +1

      I also have same doubt so what is the exact solution

  • @tanushreemalviya964
    @tanushreemalviya964 4 ปีที่แล้ว +11

    Concepts + 1 , Superb explanation sir, Thank you for this video :)

  • @udhaybrahmi502
    @udhaybrahmi502 4 ปีที่แล้ว +10

    🤯🤯🤯🤯🤯🤯
    Epic question.

  • @savvan6304
    @savvan6304 2 ปีที่แล้ว +1

    Comment section have cleared many doubts!!

  • @sweetiberwal
    @sweetiberwal 6 ปีที่แล้ว +4

    so nice teaching .....realy appreciable sir ...hats off you

  • @himanshu_9625
    @himanshu_9625 2 ปีที่แล้ว +2

    I am non cs but no problem with os with the help of your lecture...thanks 🙏

  • @manishaagrawal7565
    @manishaagrawal7565 4 ปีที่แล้ว +5

    Your lectures is really helpful and I liked your way of teaching
    Keep doing sir and thanku

  • @tanishqvyas8387
    @tanishqvyas8387 4 ปีที่แล้ว +5

    Varun Sir your lectures are a life lines. I really like your teaching style. Please keep up the good work.

  • @ChandanAkbarpuria
    @ChandanAkbarpuria 3 ปีที่แล้ว +3

    What an explanation ! Great sir

  • @RISHABH-VERMA
    @RISHABH-VERMA ปีที่แล้ว +2

    HATS OFF SIR, WHAT A QUESTION AND WHAT AN EXPLANATION 👍🏻

  • @Raj10185
    @Raj10185 ปีที่แล้ว

    Bhot saandaar sawal tha ye maine socha 3 tak jyega max but to ye ...maza aa gya

  • @jamrulanguta1688
    @jamrulanguta1688 3 ปีที่แล้ว

    ye to awesome explanation tha......dhanywaad sir

  • @ankitamondal6350
    @ankitamondal6350 4 ปีที่แล้ว +4

    Sir, make more video of practicing such type of question ..You are really good sir

  • @nishaverma7788
    @nishaverma7788 3 ปีที่แล้ว +1

    Awesome Explaination..Thank you Sir

  • @ishmamahmed8806
    @ishmamahmed8806 5 ปีที่แล้ว +3

    AWESOME explaination, sir..

  • @prasadallada6998
    @prasadallada6998 4 ปีที่แล้ว

    I watched almost all videos ...Superb explanation

  • @arnabdutta4662
    @arnabdutta4662 2 ปีที่แล้ว +14

    If we can use P10 again and again then in ques2 also at max there will be all the processes in the critical section not 3. As when CS contains P1 p10 P2 , we can take out p10 and reinsert P10 making mutex = 1 and now P3 also can be inserted and so on.. :))

    • @striderar7813
      @striderar7813 2 ปีที่แล้ว +7

      The last question is wrong in itself.
      If P1, P10 and P2 are in the CS. The value of S is 0. Now if P10 exits CS, it'll go to sleep as it will execute the "else" condition of the Down/P() statement, and would get blocked. But this cannot happen since the process is already in the CS and is trying to exit it, not enter it.

    • @rohandas4708
      @rohandas4708 4 หลายเดือนก่อน +1

      @@striderar7813 The exit of P10 is not possible without the exit of P1 or P2

    • @nasiturmilashokbhai4746
      @nasiturmilashokbhai4746 3 หลายเดือนก่อน

      ​@@rohandas4708who tell you that

  • @krishgarg5665
    @krishgarg5665 4 ปีที่แล้ว

    NIce question. Twist kaafi sahi

  • @farhanmajeed9226
    @farhanmajeed9226 3 ปีที่แล้ว

    Give me a reason why shouldn't i love this person. many many loves for you Sir. ❤

  • @rakeshrajput537
    @rakeshrajput537 6 ปีที่แล้ว +1

    your video is so nice please solve the doubt everyone who are commented

  • @ajitpal0821
    @ajitpal0821 3 ปีที่แล้ว +1

    6:18 pe mutex ki value 1 hone se pehle wo suspended list ko empty krega fir CS chalega na....??

  • @watchandgainknowledge
    @watchandgainknowledge 5 ปีที่แล้ว +2

    wow wow wow great Explain sir🤩

  • @ashishdiundi3782
    @ashishdiundi3782 4 ปีที่แล้ว +1

    very nice explanation ,really helpful

  • @erlokeshnagar
    @erlokeshnagar 4 ปีที่แล้ว

    Thanks for helping many students.......

  • @sakshigupta4683
    @sakshigupta4683 4 ปีที่แล้ว +6

    sir in the introduction part of binary semaphore you have said that if mutex=0 and the process come and block after executing p(mutex), then if we run v(mutex) thereafter, then that process will come out from the suspended list and will be in the ready queue and the value of mutex will remain as mutex=0 but in this question without thinking anything mutex value is being 0 to 1 why and what does the meaning of in the ready queue here, is this can go to the next line of the program? please clear this scenario

    • @amanagrawal1951
      @amanagrawal1951 2 ปีที่แล้ว

      I also have the same doubt ... can u please explain if u understood

  • @swagatrout3075
    @swagatrout3075 2 ปีที่แล้ว +2

    p1 enters S=0 ,now
    p10 enters S=1 as no suspended process ,now
    p2 enters S=0 ,now
    p3 tries entering gets suspended , now
    p10 exits but can't as Suspension list has P3 in it so puts P3 in ready Queue
    p10 again enters as no suspension list S=1
    p3 enters S=0
    P4 tries entering gets suspended
    p10 exits but can't as Suspension list has P4 in it so puts P4 in ready Queue
    p10 again enters as no suspension list S=1
    p4 enters S=0
    and this goes on till p9 Hence all enter C.S.

  • @bacs_aditisingri
    @bacs_aditisingri 4 ปีที่แล้ว +1

    Thank you so so much sir...🤗 U r truly providing very helpful tutorials🙏

  • @sagargupta1615
    @sagargupta1615 4 ปีที่แล้ว

    Good question.
    Maine bhi 3 answer socha tha..

  • @abhishekprajapat415
    @abhishekprajapat415 5 ปีที่แล้ว +22

    Sir, it would be appreciated if you reply to the comments, in many of your videos I have seen many had the same doubt as me but it has not been answered. In this very video in case of p10 the suspended list is not empty so why mutex value becomes 1 is not answered.

    • @AbbaJi-gm4vc
      @AbbaJi-gm4vc 5 ปีที่แล้ว +9

      Ok...Bro nice doubt ..But let's understand the v(mutex) operation... 1. V operation always executes .
      2. It will check the suspend list till it awake all the process to go in ready state .
      3. When all the processes will go in ready state then it will make the mutex value =1
      Then. U can further execute and all the processes p1 to p10 will go in C.S. .... Hope u will understand refer the standard book for better understanding

    • @AbbaJi-gm4vc
      @AbbaJi-gm4vc 5 ปีที่แล้ว +7

      One more explanation...We have to get max no. Processes in the C.S according to question so execute in this way so that it get max no. Of processes . So don't suspend any process
      After p1 process mutex will be zero then don't execute p2, execute p10 ... And so on...
      Hope u got my point in this way u will get 10 processes in the C.S.

    • @sakshigupta4683
      @sakshigupta4683 4 ปีที่แล้ว +4

      suppose all the processes are in the suspended list and then p10 executes v(mutex) then p10 itself will go to CS because v(mutex) will not let the process into the block state and moreover will take a process from suspended list to CS and p10 will come out from the CS then again v(mutex) run and come out a process from the list and then in CS like this it will go on and will empty the SL one by one in any sequence. this is the actual concept.

    • @shivanshusuryakar8692
      @shivanshusuryakar8692 4 ปีที่แล้ว

      @@sakshigupta4683 Madam, can you please elaborate the explanation ?

    • @keerthireddy8367
      @keerthireddy8367 4 ปีที่แล้ว

      For p10, at entry point, we are executing up code or signal code rather than down code. Hence mutex value is made 1 and thus the process is allowed into CS

  • @ankursaha9133
    @ankursaha9133 3 ปีที่แล้ว +4

    if p10 first exits from critical section, does'nt that mean that it is already completed and its progress is stored in PCB? Why is it again being reinserted and its execution is again starting from Entry Code?

  • @amalabdulazeez1388
    @amalabdulazeez1388 4 ปีที่แล้ว

    Thanks very much sir.God Bless

  • @rakeshrajput537
    @rakeshrajput537 6 ปีที่แล้ว +1

    real good explanation 👌🏻👌🏻

  • @cardinatia4656
    @cardinatia4656 4 ปีที่แล้ว +5

    In the 2nd case when you changed the exit code for P10 as P(mutex) there can still be 10 processes in the critical section.
    Sir if you could please check once more.

    • @anathghosh9773
      @anathghosh9773 4 ปีที่แล้ว +1

      i also have the same question

    • @nikhilkurup5184
      @nikhilkurup5184 4 ปีที่แล้ว +1

      p10 = 0 hoke exit karne ke baad, jab voh phirse critical section mai aane ki try karega, toh voh mutex ko increment nahi karega, voh pehle check karega ...... If (mutex = 1) hai tabhi voh mutex ko increment karta hai, lekin mutex = 0 hota hai jab p10 exit karta hai critical section se, so voh mutex ko incremenr karke critical section mai nahi jaa sakta hai. So, there can't be 10 processes in critical section

    • @nikhilkurup5184
      @nikhilkurup5184 4 ปีที่แล้ว

      @@anathghosh9773 p10 = 0 hoke exit karne ke baad, jab voh phirse critical section mai aane ki try karega, toh voh mutex ko increment nahi karega, voh pehle check karega ...... If (mutex = 1) hai tabhi voh mutex ko increment karta hai, lekin mutex = 0 hota hai jab p10 exit karta hai critical section se, so voh mutex ko incremenr karke critical section mai nahi jaa sakta hai. So, there can't be 10 processes in critical section

    • @pasito287
      @pasito287 3 ปีที่แล้ว +1

      @@nikhilkurup5184 p10 ko. Agr nahi nikalte hai roh tabbhi ek naya process can enter into the cs just chexk again the question and 10 process xan easily and happily live together

    • @golgappa3430
      @golgappa3430 2 ปีที่แล้ว

      @@nikhilkurup5184 but p10=0 kaise hoga bro. please make me understand

  • @ajaybachate7137
    @ajaybachate7137 3 ปีที่แล้ว +3

    but after changing the p10 exit code to p(mutex) it will make mutex 0 but if it immediately again enters then it will make mutex 1 and will enter CS and then as mutex is 1 another process can enter so there can be more than 3 numbers process even if we change P10 code

  • @mohneeshgarg8706
    @mohneeshgarg8706 6 ปีที่แล้ว +1

    Sir, very nice explaination!!!!

  • @siddharthatarafder2914
    @siddharthatarafder2914 6 ปีที่แล้ว +1

    Thanks for your explanation

  • @BiddyutHasan
    @BiddyutHasan 6 ปีที่แล้ว +1

    Great explanation...Beautiful

    • @GateSmashers
      @GateSmashers  6 ปีที่แล้ว

      Thank You so much for the appreciation. Bless you. keep learning and sharing

  • @gautamrishi769
    @gautamrishi769 4 ปีที่แล้ว +13

    Guru ji
    Ek question, last m when you change the code of P10,
    P0 agya mutex =0 then P10 agya mutex =1 then p1 agya mutex =0,
    Ab agar P10 chla gya mutex =10, but firse p10 agya mutex =1 hoga na? And them P2 can also come, to aise it can have total 10 process at a time.
    Please tell

    • @meghalpatel8195
      @meghalpatel8195 4 ปีที่แล้ว +2

      it's true

    • @fungaum7503
      @fungaum7503 4 ปีที่แล้ว

      I have the same doubt. In the second example , we can use p10 to make mutex as 1 in the same manner and it will make room for other processes to enter the Critical section.So the answer should by 10 in the second example also.Can someone clear this doubt?

    • @kairos1334
      @kairos1334 4 ปีที่แล้ว

      @@fungaum7503 Here he is assuming that each process executes only once then his case works out otherwise its 10

    • @jasleenkaur1740
      @jasleenkaur1740 4 ปีที่แล้ว +6

      Cosmo Ferrito When we move P10 out of CS it will execute P(mutex) which will put P10 in Block list. Now to wakeup P10 we need V(mutex) executed, we cannot simply remove P2 from CS and make it to enter again like previous example, not possible here.

    • @kairos1334
      @kairos1334 4 ปีที่แล้ว

      @@jasleenkaur1740 got it 😅

  • @atharvaanand6960
    @atharvaanand6960 4 ปีที่แล้ว

    Shandaar Sir🙏🙏🙏🙏🙏

  • @blender.creations
    @blender.creations 2 ปีที่แล้ว

    that was really a good trick question

  • @foodieishani
    @foodieishani 6 ปีที่แล้ว +33

    Could you please provide any good link to practice such questions...

    • @asutoshghanto3419
      @asutoshghanto3419 4 ปีที่แล้ว +2

      gfg

    • @uniqueelsa5959
      @uniqueelsa5959 2 ปีที่แล้ว +3

      Since it has been 3 years... I hope you had find a good source to practice 😅 and could you tell us?

  • @mohd.faizqureshi4581
    @mohd.faizqureshi4581 3 ปีที่แล้ว +1

    15:00
    if p1,p2,p10 are in CS, then mutex=0.
    now when we remove p10, mutex change to mutex=0, cs={p1,p2}
    again if we enter p10, then mutex change to mutex=1, cs={p1,p2,p10}
    now if i enter p3, then mutex change to mutex=0, cs={p1,p2,p10,p3}
    so in this way we can add all 10 processes,
    is this approach correct ?????

    • @SumitSharma-dh6fl
      @SumitSharma-dh6fl 3 ปีที่แล้ว +1

      No, it is not correct. After 3 processe are in Critical Section, mutex becomes 0. If you try to remove p10, you cannot because exit code of p10 has p() operation. in P(), if Mutex==0, { suspend the process}. So P10 is suspended and mutex remains 0. Hope that helps

  • @adarshah.p.3764
    @adarshah.p.3764 5 ปีที่แล้ว

    bahut acha question

  • @debasishdas2088
    @debasishdas2088 6 ปีที่แล้ว +8

    In the second example, the exit section of p10 is p(mutex) which will make mutex 0 and as you said p2 may enter the cs as for p2 entry section is p(mutex). But p10 can once more go into the cs and thereby making mutex = 1 and p can come in cs and so on. According to me in the second example also it should be 10 process at max. Please correct me if I am wrong.

    • @ayushkadyan7261
      @ayushkadyan7261 2 ปีที่แล้ว

      i also think in same way and i think you are right

  • @ritikshrivastava9442
    @ritikshrivastava9442 3 ปีที่แล้ว

    tussi great ho pajji

  • @pawanchoure1289
    @pawanchoure1289 4 ปีที่แล้ว

    very nice sir ................. great

  • @hasslefreelabs
    @hasslefreelabs 6 ปีที่แล้ว +3

    When v(mutex) will be executed in p1to p9?
    After modification, p1 may execute v(mutex) at any time right? So this willake room for p2 to p9 right?

  • @rahulagarwal8059
    @rahulagarwal8059 5 ปีที่แล้ว +1

    Great explanation 🤘

  • @abhisheksinghrajput2615
    @abhisheksinghrajput2615 2 ปีที่แล้ว

    for those who are having doubt the process will be like first p1,p10 ,p2 then p10 will be out , then p3, p10,p4, then p10 out and so on

  • @DarindazzGaming
    @DarindazzGaming 3 ปีที่แล้ว +3

    As you taught earlier we use P() for entry of a process and V() for exit then how are we using V() for entry of P10 in Code 2..??

    • @shubhamkokala1992
      @shubhamkokala1992 3 ปีที่แล้ว +3

      @Akshat Dhaka What u said is correct but the question itself is prepared in that way. Both entry and exit use V()

  • @sajansekhu8785
    @sajansekhu8785 5 ปีที่แล้ว

    nyc explanation sir..thnkss

  • @rajdeepmandal3917
    @rajdeepmandal3917 3 ปีที่แล้ว

    Explanation is well.
    But some might get confused from thinking about the rule of Mutual Exclusion, that at most one process can enter into the Critical Section at any instance of time.
    It can be another twist also.. 😅

    • @SHIVANAN2010
      @SHIVANAN2010 ปีที่แล้ว

      Exactly। Even i am confused with that

  • @pramodkarmca
    @pramodkarmca 5 ปีที่แล้ว +1

    Good job

  • @childrengarden8194
    @childrengarden8194 3 ปีที่แล้ว +1

    Sir confusion h Aapne btaya prev video m ki up. operation check krega ki suspended list empty h ya nhi agar empty h tb semaphore ki value one hogi but yha to 9 processes block h then jb 10 process up run krege to semaphore ki valu one kase hogi ,9 processes to wake nhi ho jaygi jis se block list empty hogi and semaphore ki value one hogi please explain this

  • @mariyamamreen439
    @mariyamamreen439 2 ปีที่แล้ว

    Auesome sir 😍

  • @BtechF15
    @BtechF15 ปีที่แล้ว

    Love you sir 🥳🥳🥳👌👌👌

  • @RamSharma-de6up
    @RamSharma-de6up 5 ปีที่แล้ว

    Consider the following precedence relationships between processes P1, P2, P3, P4, P5
    and P6:
    P1 before P2 and P3
    P2 before P4 and P5
    P3 before P5
    P6 after P3 and P4
    where "Pi before Pj" means that the execution of process Pi must be completed before the execution
    of process Pj .
    Define and initialise all necessary shared semaphores, and write pseudocode for all six processes
    using these semaphores in such a way that the precedence relationships above are always observed
    when the processes are run concurrently in a multiprogrammed operating system.
    Sir, How to do this question?

  • @atishasachan1818
    @atishasachan1818 6 ปีที่แล้ว +2

    Very nice video sir. But 1 more favour sir can u please provide more numerical videos on semaphore based on wait and signal operation for net or gate.

  • @yogesh8275
    @yogesh8275 4 ปีที่แล้ว +4

    Sir 2nd example me
    Agr p10 ko nikaal kr dubara enter karaynge to hmare pass semaphore ki value dubara 1 ho jaygi aise..hmare pass 1 aur prcss ko enter krne ki condition ho jaygi..
    Aur aise hi saari enter ho skti 🤔🤔

    • @sai_durga-n4h
      @sai_durga-n4h 4 ปีที่แล้ว

      NHI NIKAL SAKTE HEN KYOUNKI , P MUTEX ME 0 SE MINUS 1 KA FUNDA HIN NAHI HE

  • @mickyman753
    @mickyman753 3 ปีที่แล้ว

    if someone has doubt in case 3 ,when p10 exits then the mutex is already 0 beacuse we made enter the 2nd process too ,so now when p10 exits the mutex val=0 in P() pushes p10 in suspended list and no further process can come now

  • @PragyaShukla
    @PragyaShukla 4 ปีที่แล้ว +1

    Thanks 😊

  • @AbbaJi-gm4vc
    @AbbaJi-gm4vc 5 ปีที่แล้ว

    It shows ...Lot of effort u have done in explaining the question I have replied one doubt... Check that and correct me if I am wrong

  • @SomeshSamadder
    @SomeshSamadder 6 ปีที่แล้ว +1

    Amazing sir

  • @GAU-C--RATNAKANTAHANSE
    @GAU-C--RATNAKANTAHANSE 3 ปีที่แล้ว +1

    Thank you sir......

  • @rumiNITPatna
    @rumiNITPatna 2 หลายเดือนก่อน

    thankuuuu sir

  • @souravsinha18
    @souravsinha18 4 ปีที่แล้ว +1

    After execution of p1 is it the best case that there would be no process in suspend list and so after execution of p10 the mutex value is 1

  • @SharesGuruGyan
    @SharesGuruGyan 4 ปีที่แล้ว

    I m big fan of u sir🙏🙏🙏

  • @_wolvox
    @_wolvox 3 ปีที่แล้ว +2

    What happens exactly when P10 leaves the Critical section. It will execute the P(mutex) which will put it into the suspended state? But there's no need to suspend it as it has already completed its work with the CS?

  • @MukeshKumar-ve8tr
    @MukeshKumar-ve8tr 6 ปีที่แล้ว +1

    nice h sir video

  • @ashutoshjha7452
    @ashutoshjha7452 6 ปีที่แล้ว

    Ultimate teacher

  • @niveditakumari711
    @niveditakumari711 3 ปีที่แล้ว

    trust me ...u r a legend
    !!!..keep uploading sir !!!!..thankuuu

  • @gurindersingh412
    @gurindersingh412 3 ปีที่แล้ว +1

    Sir very nice video and very helpful
    and sir I have a question
    Once we change v() to p() the P10 will now will be in sleep() condition ?

  • @rksh631
    @rksh631 9 หลายเดือนก่อน +1

    for case 3, when we have in CS P1,P2 and P10 ...if P10 gets out, the mutex will still be 0,but if it reenters,the mutex will be 1 and than P3 will be able to enter right?

  • @swagatrout3075
    @swagatrout3075 2 ปีที่แล้ว +1

    nothing should be in the suspended list for s to become 1 according to last video in V()/Down() then problem:
    1. how did p10 enter as p2-p9 all are in suspender state
    2. even if p10 lets say have a different suspension section, how can it influence the overall mutex to change it then

    • @swagatrout3075
      @swagatrout3075 2 ปีที่แล้ว

      ok I got it

    • @swagatrout3075
      @swagatrout3075 2 ปีที่แล้ว

      p1 enters S=0 ,now
      p10 enters S=1 as no suspended process ,now
      p2 enters S=0 ,now
      p3 tries entering gets suspended , now
      p10 exits but can't as Suspension list has P3 in it so puts P3 in ready Queue
      p10 again enters as no suspension list S=1
      p3 enters S=0
      P4 tries entering gets suspended
      p10 exits but can't as Suspension list has P4 in it so puts P4 in ready Queue
      p10 again enters as no suspension list S=1
      p4 enters S=0
      and this goes on till p9 Hence all enter C.S.

  • @chiragdeo7267
    @chiragdeo7267 4 ปีที่แล้ว

    9:24 if P10 completes its critical section then why would it enter in the critical section again, it just makes a scope for a different 3rd process to come into critical section..please reply.

    • @nirantarkulkarni9170
      @nirantarkulkarni9170 4 ปีที่แล้ว

      It is possible for P10 to come again because we are running the process repeat forever..

  • @bepositive7669
    @bepositive7669 3 ปีที่แล้ว

    Second case me p3 ko bahar kar sakte hai or mutex ka value 1 ho jayega then p4 aa sakta hai critical section me.

  • @jitumanibhagabati3854
    @jitumanibhagabati3854 ปีที่แล้ว +1

    Why P10 process mutex value is updated to 1, Suspended list is not empty ?

  • @jatinkumar4410
    @jatinkumar4410 4 ปีที่แล้ว +1

    Very nice explanation sir...I have one doubt...in the last example you described...
    When P2 exits the critical section...it puts P1 in ready queue..but how P1 is gonna use the critical section, as semaphore value is still 0? Because P2 hasn't updated it when exiting....

  • @imranwahid9871
    @imranwahid9871 3 ปีที่แล้ว

    You are awesome sir.

  • @harshnigam4161
    @harshnigam4161 9 หลายเดือนก่อน +1

    sir technically last wala question galat hai, kyuki sir lets say ki critical block me abhi p1 p2 p10 ye teeno hai... but sir technically p10 chahe to uss se bahar nikal sakta hai jis se mutex ki value 0 ho jaigi aur fir firse enter kar skata hai jis se mutex ki value firse 1 ho jaigi jis situation me koi bhi dusra process firse enter kar sakta hai.. aur aise hi baar baar karke saare processes including process 10 sab critical block me ho sakte hai, to sir last me maximum number of processes ka answer 3 nahi balki 10 hoga..

    • @mysterio2552
      @mysterio2552 9 หลายเดือนก่อน +1

      but technically jab p10 leave kar rha hai, kyuki mutex 0 hai, wo block ho jayegi aur wapis enter nahi kar sakti hai na. So agar ham p10 ko nikaal rahe hai to usse aage kisi ko wake up nahi kar sakte hai, jab tak ek process bahar nahi aayegi (p1 ya p2 mein). Ye mera understanding hai. Galat hai toh please explain.

  • @VIJAYKUMAR-ff1wo
    @VIJAYKUMAR-ff1wo 2 หลายเดือนก่อน

    awsome

  • @kinthalisailakshman8193
    @kinthalisailakshman8193 6 ปีที่แล้ว +14

    In P10 case suspend list is not empty why mutex value becomes 1

    • @shivanshusuryakar8692
      @shivanshusuryakar8692 4 ปีที่แล้ว

      Has anyone got the answer to this?

    • @yajursood7888
      @yajursood7888 4 ปีที่แล้ว +1

      @@shivanshusuryakar8692 The list is empty. After p1, you can add p10. s=1 then add p2. s=0 then remove p10. s=1. then add p3 s = 0. then add p10, s = 1. then add p4, s=0 then remove p10 and so on.....
      You dont need to add or remove the process in sequential order. So you can put P5 after P1 into critical state. P10 does not have to wait for P9 to enter the CS.
      Hope this helps

    • @shivanshusuryakar8692
      @shivanshusuryakar8692 4 ปีที่แล้ว

      @@yajursood7888 but the code for V() or Up() in previous was: when suspend list is not empty then S=0 and it doesn't become S=1 , because P10 is still there in CS and S=1 tells us that CS can be accessed now! So for the case you explained it couldn't be S=1!

    • @shivanshusuryakar8692
      @shivanshusuryakar8692 4 ปีที่แล้ว

      @@yajursood7888 but the code for V() or Up() in previous video was: when suspend list is not empty then S=0 and it doesn't become S=1 , because P10 is still there in CS and S=1 tells us that CS can be accessed now! So for the case you explained it couldn't be S=1!

    • @pratyushpanthari8528
      @pratyushpanthari8528 4 ปีที่แล้ว +1

      @@shivanshusuryakar8692 but the suspend list is empty bcoz p10 is in CS not suspend list

  • @ankitathakur5989
    @ankitathakur5989 4 ปีที่แล้ว

    Thanku so much sir ji

  • @trendingai1493
    @trendingai1493 4 ปีที่แล้ว

    Very nice 👍

  • @hafsakhalil7458
    @hafsakhalil7458 5 ปีที่แล้ว

    apki wesy hi video itni achi hoti han dont say plz again and again at the end of your video

  • @prarabdh6295
    @prarabdh6295 2 ปีที่แล้ว +1

    how can V be entry code for P10?? I thought V is only for exit code

  • @poetic_
    @poetic_ 3 ปีที่แล้ว +1

    sir last lecture mai up agar 0 tha toh woh suspended ko wake karta tha ? aur kya yeh mutual exclusive hai?

  • @shubhamdhingra1473
    @shubhamdhingra1473 4 ปีที่แล้ว +1

    Why P10 will come multiple time, if that's the case it will keep on coming, increase the count, let other Processes come in and leave. ?

  • @rajeshbadariya4823
    @rajeshbadariya4823 5 ปีที่แล้ว

    nice explanation

  • @mohdhusainkhan2207
    @mohdhusainkhan2207 4 ปีที่แล้ว +3

    Tsl ,Peterson,strict alternation iske lecture kaha pe h sir

  • @sejaljain9197
    @sejaljain9197 3 ปีที่แล้ว +1

    Sir only one process can recide in the critical section...because we need to follow mutual exclusion...so y there are more

  • @Jyoti_Rani515
    @Jyoti_Rani515 5 ปีที่แล้ว +1

    Sir mutex value initially have to put 1 or we can put 2 also
    What is the reason of putting value of mutex only 1 not 2 or anyother

    • @abhishekprajapat415
      @abhishekprajapat415 5 ปีที่แล้ว

      we r using the binary semaphore and so it has value 1 and 0 only.

  • @bhaskarmishra8479
    @bhaskarmishra8479 3 ปีที่แล้ว

    6:47 sir when V(mutex) is called it will just wake a process up wont it? and it wont change the value of 1 to 0 as the suspend list is not empty...isnt it? Please correct me if I am wrong and please let me know where am I wrong...?

    • @aviraltandon8673
      @aviraltandon8673 3 ปีที่แล้ว +1

      No , there was error in the code in the previous video . when V() is called , it will first change the value of mutex to 1 , then remove the process from suspended list

    • @bhaskarmishra8479
      @bhaskarmishra8479 3 ปีที่แล้ว +1

      @@aviraltandon8673 okay... thank you so much