Тёмный

Synchronization 3: Producer/Consumer Problem 

Jacob Schrum
Подписаться 18 тыс.
Просмотров 37 тыс.
50% 1

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.

Опубликовано:

 

2 авг 2016

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 32   
@bultacoracer7729
@bultacoracer7729 7 лет назад
these are the best videos I have seen on systems programming subjects. very clear and unhurried presentation
@alexjohnson5677
@alexjohnson5677 4 года назад
You have saved my grade in Operating Systems. Thank you for this great video.
@aqua123670
@aqua123670 7 лет назад
Thank you so much, finally there's someone who doesn't speak with indian accent
@emmanuelobaro8298
@emmanuelobaro8298 7 лет назад
hahaha bro you're damb right
@GabrielHsueh
@GabrielHsueh 6 лет назад
same here, I dont know whats going on with the RU-vid, 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 лет назад
Yes, how dare an Indian person make helpful videos.
@marioben7
@marioben7 5 лет назад
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 4 года назад
@@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.
@gamest01
@gamest01 7 лет назад
your videos are underrated. good job
@llvieira10
@llvieira10 6 лет назад
Thank you. You teach this subject very well.
@franciscocarneiro
@franciscocarneiro Год назад
Thanks Jacob. Excellent presentation.
@farnooshfallah5134
@farnooshfallah5134 5 лет назад
that was excellent...thank you so much
@dianampm99
@dianampm99 4 года назад
Best videos out there!!
@siddarthkarki2196
@siddarthkarki2196 2 года назад
This is a great explanation. Thanks
@mychannelmarco
@mychannelmarco 7 лет назад
Thanks, it helped me a lot!
@gamalmohamed2102
@gamalmohamed2102 7 лет назад
Really awesome, thnx! :)
@oussamacheta7106
@oussamacheta7106 5 лет назад
Thank you so much
@anelemadonda6191
@anelemadonda6191 3 года назад
MUCH LOVE ALL THE WAY FROM south africa
@adamkejji6050
@adamkejji6050 5 лет назад
If we change the order of the two first semwait() would that change anything ?
@azistrax
@azistrax 7 лет назад
low audio ! But really nice content! THANK YOU !
@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.
@Alex-mv3ht
@Alex-mv3ht 5 лет назад
Are the Semaphores shared between a producer and its consumers? or the signals are passed through interprocess communication?
@adamkejji6050
@adamkejji6050 5 лет назад
they are shared
@jacobmilton
@jacobmilton 2 года назад
Great stuff man! A quick feedback on the audio; It's quite low in volume.
@vjekoslavkrajacic4413
@vjekoslavkrajacic4413 4 года назад
Does this work if all threads are both producers and consumers?
@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?
@lordmahakaal
@lordmahakaal 10 месяцев назад
Why do we lock n and e? , they are not shared by thread and owned by respective thread
@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.
@CraisonBailum
@CraisonBailum 6 лет назад
Is this Stallings ? :3
Далее
Banker's Algorithm explained
10:02
Просмотров 152 тыс.
Quick explanation: the Bounded-Buffer problem
7:33
Просмотров 39 тыс.
POLI зовет Газана
00:12
Просмотров 691 тыс.
Deadlock 1: Conditions For Deadlock
10:50
Просмотров 12 тыс.
All Rust string types explained
22:13
Просмотров 152 тыс.
Synchronization 2: Monitors and Condition Variables
16:07
Producer And Consumer Problem
15:42
Просмотров 34 тыс.
Dining Philosophers Problem with Solution
8:10
Просмотров 77 тыс.
Producer - Consumer Problem in Multi-Threading
25:18
Просмотров 109 тыс.
Mutex Synchronization in Linux with Pthreads
25:07
Просмотров 160 тыс.
100+ Linux Things you Need to Know
12:23
Просмотров 595 тыс.