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

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

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

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

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

  • @samarthgupta4069
    @samarthgupta4069 5 ปีที่แล้ว +441

    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 TH-cam 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 ปีที่แล้ว +775

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

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

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

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

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

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

    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 😅😅😅

  • @mahamsyed8994
    @mahamsyed8994 5 ปีที่แล้ว +66

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

    • @GateSmashers
      @GateSmashers  5 ปีที่แล้ว +15

      Thank you..keep learning and sharing..

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

    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😂

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

    Allah will give you more than you deserve one day inshaAllah

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

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

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

    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... 😘

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

      mila ki nhi job??

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

      @@samridhup lol !!!

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

      Bhai lagi job ki nahi, waiting......

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

      @@samridhup Ha bhai batao...

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

    Happy Teacher's Day to the Best teacher 😊

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

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

  • @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

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

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

  • @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!!

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

      Uu6ů

    • @namangupta4190
      @namangupta4190 5 หลายเดือนก่อน

      are to agle din dekh leta, fekoon

    • @manaspatil4316
      @manaspatil4316 5 หลายเดือนก่อน

      @@namangupta4190 Kyun Nahi ho rhi padhayi..!!!

    • @namangupta4190
      @namangupta4190 5 หลายเดือนก่อน

      @@manaspatil4316 teri ka pata nahi bhai😂

  • @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!

  • @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

  • @anniesminu8917
    @anniesminu8917 6 ปีที่แล้ว +12

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

  • @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

  • @toobashahid8675
    @toobashahid8675 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🌺

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

      Congratulations 👏

    • @khanam..2530
      @khanam..2530 2 ปีที่แล้ว

      Toba shahid, Congrats which job ?🤔

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

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

  • @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.

  • @RitikSharma-pc5yj
    @RitikSharma-pc5yj 4 ปีที่แล้ว +5

    shukr h smj aya finally :) #thanks_forever

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

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

  • @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 ❤️🥰

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

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

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

      Thank you so much 😀

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

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

  • @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

  • @shadabshaikh5644
    @shadabshaikh5644 5 ปีที่แล้ว +6

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

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

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

  • @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

  • @sakshamkanojoiakarmendra-sy4od
    @sakshamkanojoiakarmendra-sy4od หลายเดือนก่อน

    Very good & clear explanation efforts really appreciable 🎉🎉

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

    Best after Balkrishna Veerala Sir... Thank You

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

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

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

    Very Informative, really Useful

  • @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

  • @K-bhdz
    @K-bhdz 5 ปีที่แล้ว +4

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

  • @AmazingWorld-fw9oc
    @AmazingWorld-fw9oc 3 ปีที่แล้ว +1

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

  • @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...

  • @rajyavardhanrathour8598
    @rajyavardhanrathour8598 6 ปีที่แล้ว +9

    Sir plz make a video on Peterson algorithm

  • @PriyanshuRaj-gg7it
    @PriyanshuRaj-gg7it 6 หลายเดือนก่อน +2

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

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

    Excellent explanation....

  • @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 😜😜😜😂

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

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

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

    Mind blowing explanation . thank u so much sir

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

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

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

    Very nice explanation. Thankyou sir.

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

    Salute you sir ji!

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

    you are awesome......❤

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

    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.

  • @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

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

    Pura Playlist he download karlia 😃

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

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

  • @Vijay-hc2vj
    @Vijay-hc2vj 6 ปีที่แล้ว +2

    Awesome explanation

  • @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?

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

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

  • @RanjeetSingh-yh4ki
    @RanjeetSingh-yh4ki 6 ปีที่แล้ว +2

    Bahut acha samajh aa gaya..thanku

  • @solutionhub4985
    @solutionhub4985 9 หลายเดือนก่อน

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

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

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

  • @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.

  • @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..

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

    Your explanation is amazing. Thank you so much

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

    Thank You Soo Much Sir Ji🙌

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

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

  • @PriyanshuRaj-gg7it
    @PriyanshuRaj-gg7it 6 หลายเดือนก่อน +1

    Thanks sir 🎉❤

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

    really helpful, your each video is awesome, teching way, content all is outstanding. thanks for your effort.

  • @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

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

    sir, you are really a blessing. thankyou so much for your dedication and devotion. God bless you. also please keep motivating students in your videos. sometimes, students like me get demotivated when we cant understand something.

  • @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?

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

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

  • @laibanawaz7789
    @laibanawaz7789 4 หลายเดือนก่อน

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

  • @aarushroy913
    @aarushroy913 6 หลายเดือนก่อน +2

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

  • @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" TH-cam has given you option you can use it in either way.

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

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

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

    Thanks a lot bhaiya❤

  • @__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!! 🤕

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

    Understood every bit of this video.Thanks sir.

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

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

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

    great sir

  • @Luffy_2804
    @Luffy_2804 9 หลายเดือนก่อน

    BEST EXplanation

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

    Nice

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

    sir never came across any teacher like you ...absolutely amazing ..thank you

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

    Brilliant explanation

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

    Awesome sir🤩

  • @sonus-ye9vy
    @sonus-ye9vy 5 หลายเดือนก่อน +1

    No one teaching like you ❤❤❤ thnks sir

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

    excellent explanation

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

    Sirji moj krdi ap ne..😍😍😍

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

    Thanks alot 😀

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

    Such a good channel

  • @Zoya12685
    @Zoya12685 7 หลายเดือนก่อน

    Well done sir 💯

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

    Great 😍

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

    Very awesome explanation sir. thanks

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

    Sir please make a video series on SYSTEM PROGRAMMING (based on IBM 360) (Ref.Book: J J Donovan). There are no other books available than the mentioned one and also no one on youtube has uploaded perfect video series for it. The subject is based on 60% numerics and 40% theoretical. Near about 40 to 45 Universities in India have this subject in their syllabus and the students are getting difficulties in this subject.

  • @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](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html) Producer-consumer problem is a standard problem of multi-process synchronization
    [03:14](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html94) Explanation of the producer code functionality
    [06:51](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html) CPU converts instructions into micro instructions
    [10:05](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html) Updating out variable to track consumer consumption
    [13:10](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html) Process synchronization in producer-consumer problem
    [16:31](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html) Producer-Consumer Code Execution Flow
    [19:54](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html194) Explanation of the execution flow of a program consisting of multiple instructions
    [23:29](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html409) Race condition causing wrong value in buffer count
    ---------------------------------
    Detailed Summary for [L-3.2: Producer Consumer Problem | Process Synchronization Problem in Operating System](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html) by [Merlin](merlin.foyer.work/)
    [00:01](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.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](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.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](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.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](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.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](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.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](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.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](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.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](th-cam.com/video/iMD1Z3f9ioI/w-d-xo.html409) Race condition causing wrong value in buffer count
    - Race condition occurs when wrong values compete
    - Process synchronization is necessary to avoid this problem

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

    thnx a lot

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

    Absolutely interesting

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

    In the consumer code the "out" after "buffer" should be enclosed in square brackets and not round brackets.

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

    Wow!!
    Thankyou so much sir!!!❤

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

    awesome! explanation and case