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.
these are the best videos I have seen on systems programming subjects. very clear and unhurried presentation
Thank you so much, finally there's someone who doesn't speak with indian accent
hahaha bro you're damb right
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~
Yes, how dare an Indian person make helpful videos.
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
@@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.
You have saved my grade in Operating Systems. Thank you for this great video.
your videos are underrated. good job
Thanks Jacob. Excellent presentation.
This is a great explanation. Thanks
Are the Semaphores shared between a producer and its consumers? or the signals are passed through interprocess communication?
they are shared
that was excellent...thank you so much
MUCH LOVE ALL THE WAY FROM south africa
Why do we lock n and e? , they are not shared by thread and owned by respective thread
Great stuff man! A quick feedback on the audio; It's quite low in volume.
If we change the order of the two first semwait() would that change anything ?
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?
Thank you. You teach this subject very well.
Does this work if all threads are both producers and consumers?
create queue thread one producer thread and several consumer threads..can u give brief explanation about concept and coding part in c++threads.
i don't understand why your loop condition say count==buffersize, count is initialised to zero, buffersize to size
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.
Thanks, it helped me a lot!
Best videos out there!!
Thank you so much
Really awesome, thnx! :)
Is this Stallings ? :3
low audio ! But really nice content! THANK YOU !