L-3.2: Producer Consumer Problem | Process Synchronization Problem in Operating System

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024

Комментарии • 381

  • @SKG78669
    @SKG78669 4 года назад +490

    "This is the kind of content i pay my internet bill for"💲❤

  • @samarthgupta4069
    @samarthgupta4069 5 лет назад +444

    We are paying high fees in gate coaching for all these knowledge. But in this channel , it is available in free of cost... Thank you so much sir. Really this is non profit RUclips channel.🙏🙏🙏🙏

    • @mdsuhailakhtar1603
      @mdsuhailakhtar1603 4 года назад +6

      nice channel . i like your method of teaching sir.

    • @miraclespiritualastro
      @miraclespiritualastro 4 года назад

      Yes sahi bol rahe hai aap.....mai video me itana achha se nahi bataya bhai jitana chha ye video me bataya gaya.....thanx sir by heart ❤️🥰

    • @aryaman_godara
      @aryaman_godara 2 года назад +8

      not for profti kaise hua?... pani marne ki aadat chod do mitar

    • @vaibhav4883
      @vaibhav4883 2 года назад

      budhwa bhatar

    • @111rhishishranjan2
      @111rhishishranjan2 Год назад +1

      @@aryaman_godara Yaa sir earn more than gate coaching teacher via Add on youtube ..He won't understand it because he see he is not palyinlg anything .I am not saying that sir should not run adds but he sould understand that its not free , Add = Money , much more money ...

  • @umanggupta9950
    @umanggupta9950 4 года назад +782

    If you want to crack Gate and don't want to spend money on coaching, Become Varun Sir's cameraman!

  • @gomzysharma
    @gomzysharma 3 года назад +73

    These videos are "gems". I salute this guy for making Computer fundamentals more interesting which is where our colleges always fail.

  • @mahamsyed8994
    @mahamsyed8994 5 лет назад +68

    OMG 😭😭😭 you're toooooooo good thank you for existing 😭😭❤❤

    • @GateSmashers
      @GateSmashers  5 лет назад +15

      Thank you..keep learning and sharing..

  • @suchitrapathak7391
    @suchitrapathak7391 4 года назад +135

    I completed my engineering in 2017 and now m understanding all the concept 😆

    • @imamsaidachinna3577
      @imamsaidachinna3577 4 года назад

      What are u doing now

    • @chandankumartagzero
      @chandankumartagzero 4 года назад +1

      Same here

    • @ritvikdabas2436
      @ritvikdabas2436 4 года назад +1

      😂😂😂👌👌👌
      Same here

    • @Official-tk3nc
      @Official-tk3nc 4 года назад +2

      It mean You have completed your engineering in 2017 and till now you did not get any job so you are learning everything from first??? right??

    • @niveditha-7555
      @niveditha-7555 4 года назад +7

      woah.. if I were u I would never have touched books… I’m just waiting to graduate😂

  • @saurabhnair844
    @saurabhnair844 4 года назад +40

    I am govt. employee again starting preparation for CS after 5 years of graduation. Your channel has been a great help for me!!! I wish all the success to you in life. My best wishes. Keep it up sir.

    • @kewtomrao
      @kewtomrao 3 года назад +2

      How is the prep going on brother?

    • @111rhishishranjan2
      @111rhishishranjan2 Год назад

      Did you crack gate'?

    • @arshadalam923
      @arshadalam923 9 месяцев назад

      Government job mein jyda kam kara raha hai kya bhai 😅😅😅

  • @mdmonis_
    @mdmonis_ 3 года назад +20

    Saare topics me inta clear concept , imagine sir ne kitni mehnat ki hai😮😮😮😮

  • @harshrathore6921
    @harshrathore6921 3 года назад +24

    Not all heros wear cap.Great job for many students who cannot afford coaching.

  • @jamilahmedahmed8187
    @jamilahmedahmed8187 4 года назад +55

    Allah will give you more than you deserve one day inshaAllah

  • @NikhilWhiskyKumar
    @NikhilWhiskyKumar 4 года назад +26

    Both varun singla sir & sanchit jain sir r my best mentor! Thanks fr having ur vdos helped alot job lagne k bad aapko mithai khilaunga... 😘

  • @shamimkamalabdulnazar37
    @shamimkamalabdulnazar37 3 года назад +10

    Great teacher ...each and every step explained very well ..

  • @saptarshidas979
    @saptarshidas979 4 года назад +20

    20:38 oh ho now I get it
    Good job sir
    And those who are saying sir don't know how to program in c well let me tell you he is showing a snapshot of how it works just like pseudo code , if you are so good at programming why wasting time here go to google or microsoft if you are big coder
    He is providing free lectures doesn't mean you will trash talk with him
    He is a human and every human makes mistakes so if he makes mistakes doesn't mean you need behave rudely that why did you make mistakes, ask politely
    Show some respect 🙏🙏🙏🙏

    • @bhaveshkumar6842
      @bhaveshkumar6842 2 года назад +1

      Bhai galat code galat code hota hai. Aur galat code ko point out karne pe koi apne aap ko bada programmer nahi samajh raha hai jo bewajah Google or Microsoft le aa rahe ho. Creator ko sahi code (ya pseudocode) Comments mein add kar dena chahiye ya isi video mein hi edit kar dena chahiye.

    • @JAJAJAJA-el5li
      @JAJAJAJA-el5li Год назад

      ​@@bhaveshkumar6842ja pehle pseudocode ka matlab pta karke aa

    • @bhaveshkumar6842
      @bhaveshkumar6842 Год назад +1

      @@JAJAJAJA-el5li ok bhrata. Baat ko 1 saal ho gaye. Main ye video wapas nahi dekh raha kyunki ab mujhe zarurat nahi hai par inka content achcha rehta hai. Aap comments se distract hoke apna samay zaya mat kijiye. Aap jis bhi exam/interview ke liye padh rahe hain uspe dhyan dijiye. All the best

  • @shivamk843
    @shivamk843 3 года назад +10

    one day before my final exams and completing the entire syllabus here today .... God bless u Sir.

  • @pgoswami1437
    @pgoswami1437 4 года назад +22

    Happy Teacher's Day to the Best teacher 😊

  • @anniesminu8917
    @anniesminu8917 6 лет назад +12

    So clear explanation...quite helpful for me to teach my students...

  • @safiqlodi834
    @safiqlodi834 5 лет назад +19

    One of the best explanations I have ever witnessed, dude you have have got some great teaching skills. Please continue with the kind of work you are doing. :) All the best!

  • @manaspatil4316
    @manaspatil4316 3 года назад +36

    My daily internet quota was exhausted but I recharged it with data addon just to watch this lecture , coz I know this lecture really worth it !!! lots of love from Maharashtra Sir!!

  • @jyotiverma-iq4br
    @jyotiverma-iq4br 3 года назад +10

    Varun sir, you play a crucial role in my life. You have helped me in clearing all my stupid to real effort bearing doubts.
    I am so so thankful to you.
    your efforts won't go vain.
    May God bless you with happy and healthy life so that you can give life to students.
    Your student

  • @toobashahid1205
    @toobashahid1205 2 года назад +3

    I watched your tutorials and prepared process sychronization topic and i cleared my Demo (Alhamdulillah) and now i got Job 💖☺️
    Still im preparing my daily OS topics from your Channel🌟
    Love and respect from PAK🌺

  • @tanishqvyas8387
    @tanishqvyas8387 3 года назад +7

    Your videos are really really helpful sir. Please keep up the good work. We really appreciate it

  • @miraclespiritualastro
    @miraclespiritualastro 4 года назад +1

    Yes sahi bol rahe hai aap.....mai video me itana achha se nahi bataya bhai jitana chha ye video me bataya gaya.....thanx sir by heart ❤️🥰

  • @shuhelahmed1036
    @shuhelahmed1036 4 года назад +38

    do you know why hes so effective? when he emphasize on small details like buffer is memory space in ram that is my friend very important.....that small information gives you ability to picture things in your head lot of good teacher forget that.
    thanks you anyway

  • @chhawiprasad3755
    @chhawiprasad3755 3 года назад +7

    You're an angel.. Thanks for saving me man! Keep going, you're an amazing person to help lakhs of students.

  • @sanjivanipande4242
    @sanjivanipande4242 3 года назад +3

    Your all videos are just awesome.. Never get bored, God bless you!!!

  • @faishalimam9020
    @faishalimam9020 4 года назад +1

    we had never seen teacher like u and way of teaching provide us.....brilliant

  • @RitikSharma-pc5yj
    @RitikSharma-pc5yj 4 года назад +5

    shukr h smj aya finally :) #thanks_forever

  • @shadabshaikh5644
    @shadabshaikh5644 5 лет назад +6

    Nice Explanation!!!!!!!!!!!!!!!

  • @narendrakumarnadipena318
    @narendrakumarnadipena318 Год назад +1

    Your service to the society is truly un-matchable.Thank you so much sir

  • @K-bhdz
    @K-bhdz 5 лет назад +4

    Vry nice xplanation topic sir great going .....keep it up sir😊

  • @saketsingh20
    @saketsingh20 6 лет назад +4

    Best after Balkrishna Veerala Sir... Thank You

    • @GateSmashers
      @GateSmashers  6 лет назад +2

      Hii Saket..Thanku... Keep learning and sharing

  • @harshmore6664
    @harshmore6664 4 года назад +2

    Your explanation is too good, thank you so much, it help a lot

  • @devendunegi247
    @devendunegi247 3 года назад +4

    i think while(count!=n) will be in the producer code and (count!=0 ) since then only the loop will terminate else there will be segmentation error

  • @saketmarodia5812
    @saketmarodia5812 6 лет назад +2

    Very Informative, really Useful

  • @irammatia9558
    @irammatia9558 6 лет назад +3

    merci beaucoup Monsieur, malgré que je ne maitrise ni l'Anglais ,ni Hindi mais j'ai bien compris votre explication. Merci infiniment

    • @GateSmashers
      @GateSmashers  6 лет назад +8

      J'aime la façon dont tu m'apprécies. C'est un gros complément pour moi. Dieu vous protège.
      Merci beaucoup

    • @ishanpand3y
      @ishanpand3y 5 лет назад

      @@GateSmashers sir you know this language 🧐

    • @HITMANTECHWORLD
      @HITMANTECHWORLD 5 лет назад +4

      @@ishanpand3y google translation 😜😜😜😂

  • @gargseema1
    @gargseema1 5 лет назад +2

    Mind blowing explanation . thank u so much sir

  • @rusiraliyanage6643
    @rusiraliyanage6643 3 года назад +15

    Dear Sir , You explain the theories very well and it would be a very pleasure if you can do the lectures in English as much as possible now from 2021 so the people from world wide can understand and by the way I am a Sri Lankan IT Undergraduate :)

    • @GateSmashers
      @GateSmashers  3 года назад +4

      Sure..will try

    • @swapnilnaikwadi7326
      @swapnilnaikwadi7326 10 месяцев назад

      Bro instead of asking for English, understand the problem in India here many college try to make communication better instead of enriching the knowledge of students, so in Hindi we understand the concept clearly

  • @shwetachauhaan7266
    @shwetachauhaan7266 5 лет назад +4

    V nice ....first time i have understood this problem

  • @dikshatiwari45
    @dikshatiwari45 5 лет назад +8

    Osm video... Heartly Thanku so much sir for your great work...

  • @sakshamkanojoiakarmendra-sy4od
    @sakshamkanojoiakarmendra-sy4od Месяц назад

    Very good & clear explanation efforts really appreciable 🎉🎉

  • @rajanbhave8610
    @rajanbhave8610 4 года назад +1

    Excellent explanation....

  • @abdulqadirkhan390
    @abdulqadirkhan390 4 года назад +4

    Bro i am from Pakistan
    Your lecture and teaching method is amazing.... ❤️❤️❤️
    Bas end py ap thora sa side py ho jaya karain taky hum pory white board ka screenshot la sakain...
    Thanks

  • @rajyavardhanrathour8598
    @rajyavardhanrathour8598 6 лет назад +9

    Sir plz make a video on Peterson algorithm

  • @RanjeetSingh-yh4ki
    @RanjeetSingh-yh4ki 6 лет назад +2

    Bahut acha samajh aa gaya..thanku

  • @abhishekshrivastav6193
    @abhishekshrivastav6193 4 года назад +3

    you are awesome......❤

  • @hiraljain1876
    @hiraljain1876 4 года назад +1

    Very nice explanation. Thankyou sir.

  • @PriyanshuRaj-gg7it
    @PriyanshuRaj-gg7it 7 месяцев назад +2

    I am very lucky that i am in 2024 and watching your lecture to do best in my semester 🎉

  • @muhammadnabeedhaider4926
    @muhammadnabeedhaider4926 4 месяца назад

    preemption can occur anywhere if we do not use sempahores/mutex or any other synchronization technique, but for concept it is easier to assume that preemption occurs only at some points.

  • @Edupro-d1y
    @Edupro-d1y 6 дней назад

    Sir,your expalnation is really good.
    I have a suggestion when you do any small mistakes in the video like in the above video you have taken in as 4 instead of 3 please give a message while editing that it is 3 .
    because I stopped the video and thinking how in is 4 instead of 3 , I thought it was bit time taking so please look into it ..... This is a small request.

  • @pramodkhade2554
    @pramodkhade2554 3 года назад +1

    Salute you sir ji!

  • @Jinkazama123
    @Jinkazama123 3 года назад

    Mashallah very helpful video no one teach like this on you
    Tube

  • @Vijay-hc2vj
    @Vijay-hc2vj 6 лет назад +2

    Awesome explanation

  • @computerguy3550
    @computerguy3550 2 года назад +1

    Thank You Soo Much Sir Ji🙌

  • @PriyanshuRaj-gg7it
    @PriyanshuRaj-gg7it 7 месяцев назад +1

    Thanks sir 🎉❤

  • @ravitejakompalli7032
    @ravitejakompalli7032 3 года назад +2

    On the consumer side, I think the count should be initialized to -1 since the 0th index has a value stored in it and if count == 0 then the while loop will run infinite times even when we are having data stored

    • @Tony-cw6om
      @Tony-cw6om 3 года назад +1

      Count is just used to know how many indexes are there ..like the total data
      As you said he there is data stored in 0th index count will be incremented right in producer's code?

  • @annapurnabichchal5860
    @annapurnabichchal5860 Год назад

    U r my best teacher in my life thank you so much sir .❤

  • @chillpillgamer4980
    @chillpillgamer4980 3 года назад

    best video of sir i have ever seen.. untill now

  • @shahbazhraja
    @shahbazhraja 4 года назад

    Sir aapke Vidoes , se semester nikaal paa rha hu. Please keep doing what you do !

  • @harshith_takkala
    @harshith_takkala 3 года назад +2

    Thanks a lot bhaiya❤

  • @samratmohansunkar8247
    @samratmohansunkar8247 6 лет назад

    Bahut achha method hai ..sir ..samjh aa gaya hai ab..

  • @gamercoder4551
    @gamercoder4551 2 года назад +1

    Pura Playlist he download karlia 😃

  • @snehaprasad1755
    @snehaprasad1755 3 года назад

    Those who are disliking the lecture , why you people even come here? If you are envious about his channel growth then let me clear you one thing, those who put effort in his work will definitely go ahead. Rest is your wish "like or dislike" RUclips has given you option you can use it in either way.

  • @manjuvimal8114
    @manjuvimal8114 2 года назад

    we feel blessed varun sir..god blesss you with peace and prosperity

  • @koushikjana849
    @koushikjana849 4 года назад +2

    Your explanation is amazing. Thank you so much

  • @MANOJSHARMA-yg2lu
    @MANOJSHARMA-yg2lu 5 лет назад +3

    sir plz its a humble request to u to upload of automata and data structure ,,,,mindblowing teacher guider u re thnkuu fr such nice video

  • @solutionhub4985
    @solutionhub4985 9 месяцев назад

    Done my full exam preparation from you and got passed thank you sir ❤🎉

  • @binaykholiya4780
    @binaykholiya4780 2 года назад

    Thank You Sir .....You are doing a great Job ....

  • @AmazingWorld-fw9oc
    @AmazingWorld-fw9oc 3 года назад +1

    I was trying to escape from os until I found this channel.

  • @aniketsinha2826
    @aniketsinha2826 3 года назад +1

    great sir

  • @AhmadKing-sd7bq
    @AhmadKing-sd7bq 2 года назад +1

    Sir while explaining case 1 you said that producer will check while condition if condition is true then producer will be in infinite loop. The question is that if producer enters in infinite loop then how it would came out from loop?

  • @suchitachaudhary
    @suchitachaudhary 2 года назад

    thankyou so much sir.....i have really learned a lot......from u.....nd u are doing amazing job nd your lectures are really very knowledgable...nd interesting.....thanks a lot sir for putting so much efforts for us.

  • @preetichauhan7530
    @preetichauhan7530 3 года назад +1

    Nice

  • @Luffy_2804
    @Luffy_2804 10 месяцев назад

    BEST EXplanation

  • @salilshukla2686
    @salilshukla2686 3 года назад

    Understood every bit of this video.Thanks sir.

  • @adityaparida6954
    @adityaparida6954 2 года назад +1

    thnx a lot

  • @shreya5235
    @shreya5235 2 года назад +1

    Thanks alot 😀

  • @laibanawaz7789
    @laibanawaz7789 4 месяца назад

    sir g apko 2x pe sunany ki aadat hugye he hamy respect from pakistan

  • @codingmadeeasy3693
    @codingmadeeasy3693 3 года назад +1

    Funny enough some of the explanation is in Hindi and I don't understand Hindi but the teacher is too good I understand the concept. well explained and well presented

  • @waghibahmad4520
    @waghibahmad4520 Год назад +3

    The producer consumer problem involves two parallel processes sharing resources or memory. A producer produces an item and a consumer consumes it from a buffer. They share a global variable and local variables for incrementing and decrementing the buffer size. This example explores a simple case of the producer producing an item X1 in a buffer size of 8.
    [00:01](ruclips.net/video/iMD1Z3f9ioI/видео.html) Producer-consumer problem is a standard problem of multi-process synchronization
    [03:14](ruclips.net/video/iMD1Z3f9ioI/видео.html94) Explanation of the producer code functionality
    [06:51](ruclips.net/video/iMD1Z3f9ioI/видео.html) CPU converts instructions into micro instructions
    [10:05](ruclips.net/video/iMD1Z3f9ioI/видео.html) Updating out variable to track consumer consumption
    [13:10](ruclips.net/video/iMD1Z3f9ioI/видео.html) Process synchronization in producer-consumer problem
    [16:31](ruclips.net/video/iMD1Z3f9ioI/видео.html) Producer-Consumer Code Execution Flow
    [19:54](ruclips.net/video/iMD1Z3f9ioI/видео.html194) Explanation of the execution flow of a program consisting of multiple instructions
    [23:29](ruclips.net/video/iMD1Z3f9ioI/видео.html409) Race condition causing wrong value in buffer count
    ---------------------------------
    Detailed Summary for [L-3.2: Producer Consumer Problem | Process Synchronization Problem in Operating System](ruclips.net/video/iMD1Z3f9ioI/видео.html) by [Merlin](merlin.foyer.work/)
    [00:01](ruclips.net/video/iMD1Z3f9ioI/видео.html) Producer-consumer problem is a standard problem of multi-process synchronization
    - Cooperative processes share something common between them, it could be code, resources, memory, or some variable
    - The producer produces an item and places it in the buffer, the consumer consumes the item and brings it out from the buffer to process
    [03:14](ruclips.net/video/iMD1Z3f9ioI/видео.html94) Explanation of the producer code functionality
    - Producer code produces items and adds it to the buffer. If the buffer is full, producer gets stuck in an infinite loop.
    - Count variable is used by both producer and consumer to keep track of the number of items in the buffer.
    [06:51](ruclips.net/video/iMD1Z3f9ioI/видео.html) CPU converts instructions into micro instructions
    - Instructions are first loaded into register for efficiency
    - An example of incrementing and storing count in memory is explained
    [10:05](ruclips.net/video/iMD1Z3f9ioI/видео.html) Updating out variable to track consumer consumption
    - Out variable shows the next value in buffer where consumer can consume
    - When consumer consumes an item, out is incremented from 0 to 1 and count variable is decreased by 1
    [13:10](ruclips.net/video/iMD1Z3f9ioI/видео.html) Process synchronization in producer-consumer problem
    - Producer and consumer can work without synchronization
    - In case of unsynchronized processes, buffer can cause issues with slot tracking.
    [16:31](ruclips.net/video/iMD1Z3f9ioI/видео.html) Producer-Consumer Code Execution Flow
    - Producer inserts X4 into buffer IN at position 3 and increments IN and count
    - Producer code gets preempted before executing its 3rd instruction and consumer consumes X1 from buffer out
    [19:54](ruclips.net/video/iMD1Z3f9ioI/видео.html194) Explanation of the execution flow of a program consisting of multiple instructions
    - Instructions are executed partially before the process is pre-empted
    - The process resumes from where it left off
    [23:29](ruclips.net/video/iMD1Z3f9ioI/видео.html409) Race condition causing wrong value in buffer count
    - Race condition occurs when wrong values compete
    - Process synchronization is necessary to avoid this problem

  • @jsr7135
    @jsr7135 4 года назад +1

    You are the only hope in my life. Mai prti hi apki videos dekhne k liye hu... 😂😂😂

  • @uttamsundarray7353
    @uttamsundarray7353 3 года назад

    Thank you Sir for such distinctive content.... I am very grateful to you!!!

  • @GeerishaAcharya
    @GeerishaAcharya 5 лет назад +2

    Thank you so much sir..🙏🙏 sir one request to you pls mention video number also so that we'll able to watch video in serially manner..

  • @__sagar_shah__591
    @__sagar_shah__591 3 года назад +1

    My HOD skipped this topic saying its a silly topic, now I know what exactly is RACE CONDITION. Holy crap it blew my mind when it all came together at 25:29!! 🤕

  • @garrysandhu4197
    @garrysandhu4197 3 года назад

    Very awesome explanation sir. thanks

  • @adnanfaisalmalik3438
    @adnanfaisalmalik3438 Год назад

    excellent explanation

  • @nazreenfathima8330
    @nazreenfathima8330 2 года назад

    Awesome sir🤩

  • @MaxCse18
    @MaxCse18 3 года назад +1

    Great 😍

  • @iamgroot2810
    @iamgroot2810 2 года назад

    Brilliant explanation

  • @deepaliroyy
    @deepaliroyy Год назад

    Wow!!
    Thankyou so much sir!!!❤

  • @aarushroy913
    @aarushroy913 6 месяцев назад +3

    bhaiyaaaaa 6 hona chahiye, meri gf ney bola, 1+2+3=6 and she's smart!!!

  • @vasudhatapriya6315
    @vasudhatapriya6315 5 лет назад +2

    Thankyou!

  • @Zoya12685
    @Zoya12685 7 месяцев назад

    Well done sir 💯

  • @melodytunes2204
    @melodytunes2204 Год назад

    This guy is way better than college. I think they should play videos from gate smashers instead of those boring lectures.

  • @apurbadutta3253
    @apurbadutta3253 2 года назад

    Absolutely interesting

  • @aseelakausar9283
    @aseelakausar9283 2 года назад

    thank sir good lecture

  • @HelloWorld40408
    @HelloWorld40408 Год назад

    Thank You Sir

  • @dirgha1810
    @dirgha1810 5 лет назад +1

    loads and loads of thanks to you. :)

  • @deepkaran7169
    @deepkaran7169 6 лет назад +1

    very good sir ji

  • @zahramohsin1102
    @zahramohsin1102 2 года назад

    U are very good teacher♥️♥️♥️ may Allah bless u...... ameen

  • @shrustipal284
    @shrustipal284 3 года назад

    awesome! explanation and case