Synchronization 3: Producer/Consumer Problem

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • The producer/consumer problem is a common synchronization problem in operating systems in which producer threads store data in a buffer for consumer threads to extract and use. Synchronization is needed to assure that the buffer does not overflow or underflow, and to assure exclusive access to the buffer whenever a thread is reading/writing from/to it. A solution using semaphores is presented, followed by a solution using a monitor. Based on content from the book Operating Systems: Internals and Design Principles, by William Stallings.

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

  • @bultacoracer7729
    @bultacoracer7729 7 лет назад +26

    these are the best videos I have seen on systems programming subjects. very clear and unhurried presentation

  • @aqua123670
    @aqua123670 7 лет назад +80

    Thank you so much, finally there's someone who doesn't speak with indian accent

    • @emmanuelobaro8298
      @emmanuelobaro8298 7 лет назад +2

      hahaha bro you're damb right

    • @ghxsp
      @ghxsp 7 лет назад +2

      same here, I dont know whats going on with the RUclips, must be someone who speaks English can explain the computer course, but somehow recently while I searching tutorial course, all title in English but with strong Indian accent people who was doing those recording. I am not saying they did not explain well or teach well, some of them did great job, it just hard to understand what they are saying most of the time.... glad finally get one video not with that Indian accent. That really helps~

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

      Yes, how dare an Indian person make helpful videos.

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

      I thought I was the only one lol. Been searching for non Indians videos for hours, I even checked my youtube location to make sure is not in India

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

      @@glahf8521 I have no problems (and I don't think the OP does either) with Indian videos, especially if they are helpful. But they are difficult to understand for native english speakers.

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

    You have saved my grade in Operating Systems. Thank you for this great video.

  • @gamest01
    @gamest01 8 лет назад +9

    your videos are underrated. good job

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

    Thanks Jacob. Excellent presentation.

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

    This is a great explanation. Thanks

  • @Alex-mv3ht
    @Alex-mv3ht 6 лет назад +2

    Are the Semaphores shared between a producer and its consumers? or the signals are passed through interprocess communication?

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

    that was excellent...thank you so much

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

    MUCH LOVE ALL THE WAY FROM south africa

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

    Why do we lock n and e? , they are not shared by thread and owned by respective thread

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

    Great stuff man! A quick feedback on the audio; It's quite low in volume.

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

    If we change the order of the two first semwait() would that change anything ?

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

    In the example where you are using semaphores to solve the producer/consumer problem, why have have signalled consumer semaphore after coming out of the critical section? Couldn't you just have added that to the critical section?

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

    Thank you. You teach this subject very well.

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

    Does this work if all threads are both producers and consumers?

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

    create queue thread one producer thread and several consumer threads..can u give brief explanation about concept and coding part in c++threads.

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

    i don't understand why your loop condition say count==buffersize, count is initialised to zero, buffersize to size

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

      This checks the Overflow. If the buffer is full; (count==buffersize), wait and don't enter the critical section because that will overwrite valid data.
      First iteration, this condition is not true, count=0, So we don't have to wait. Produce data.

  • @mychannelmarco
    @mychannelmarco 8 лет назад

    Thanks, it helped me a lot!

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

    Best videos out there!!

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

    Thank you so much

  • @gamalmohamed2102
    @gamalmohamed2102 7 лет назад

    Really awesome, thnx! :)

  • @CairosNaobum
    @CairosNaobum 7 лет назад +2

    Is this Stallings ? :3

  • @azistrax
    @azistrax 7 лет назад

    low audio ! But really nice content! THANK YOU !