Тёмный

Quick explanation: the Bounded-Buffer problem 

Binary Wisdom
Подписаться 416
Просмотров 40 тыс.
50% 1

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

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 42   
@christianimmanuelk1751
@christianimmanuelk1751 4 года назад
what is the example in real life?
@binarywisdom4501
@binarywisdom4501 4 года назад
It is used often when data stream must be arranged between threads or processes, maybe even between a process and a hardware. For example, the bounded bounded buffer data structure is very popular in audio programming. In audio programming, it is usually called "ring buffer". The implementation of such ring buffers is usually different from textbook solutions because at least one party is a real-time thread and should not block (can't wait). Audio programmers usually use "lock-free" solutions based on atomics. For the discussion of specific use cases, check the following cool presentation from CPPCon. The speaker talks about bounded buffer usage. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-boPEO2auJj4.htmlm53s Also, here is a couple of links to the Audacity code. Files RingBuffer.h and RingBuffer.cpp contain the real-life implementation of the bounded buffer. github.com/audacity/audacity/blob/master/src/RingBuffer.h github.com/audacity/audacity/blob/master/src/RingBuffer.cpp
@Tracing0029
@Tracing0029 4 месяца назад
Basically any limited resources which is shared between processes (by processes I mean an abstract process, it could be thread, a file descriptor etc.).
@dp-mason
@dp-mason 5 лет назад
It's people like you that make it possible for me to pass my exams without a tutor. Thank you so much.
@binarywisdom4501
@binarywisdom4501 5 лет назад
You are welcome!
@johnl2132
@johnl2132 4 года назад
This video was so well made and clearly understandable that I just purchased a subscription. (The price also was right and so it was a no-brainer.) Thank you!
@binarywisdom4501
@binarywisdom4501 4 года назад
Thank you for your kind words and hope it will be helpful.
@BlackStormGamingRo
@BlackStormGamingRo 3 года назад
Great video. I need to study for an exam and my teacher's course is unclear and full of mistakes. Your video was most useful.
@bsce100
@bsce100 5 лет назад
This was the best explanation that I've come across! Thank you!!
@binarywisdom4501
@binarywisdom4501 5 лет назад
Thank you!
@yasmikash
@yasmikash 5 лет назад
the best EXPLANATION EVER!
@binarywisdom4501
@binarywisdom4501 5 лет назад
Thank you!
@stevenmcgown6552
@stevenmcgown6552 3 года назад
Underrated channel. Thank you, I subscribed.
@nadiakacem24
@nadiakacem24 3 года назад
thank you so much
@indiamoneypurse5738
@indiamoneypurse5738 5 лет назад
Good Explanation, Hope to see some more videos on operating system topic. :)
@mohamedredha9586
@mohamedredha9586 2 года назад
you are a legend sir
@Tracing0029
@Tracing0029 4 месяца назад
Nice and clear explanation! I am wondering, is it really needed ot have 2 semaphores? You could just use one non-binary semaphore and increment and decrement it accordingly based on which process does which operation.
@ashensavinda99
@ashensavinda99 3 года назад
What a great explanation!!!
@haidershah5679
@haidershah5679 6 лет назад
Thank u.... Great video ...nice explaination
@binarywisdom4501
@binarywisdom4501 6 лет назад
I'm glad it was helpful.
@lata7914
@lata7914 5 лет назад
Excellent explaination
@Pages_Perfected
@Pages_Perfected 2 года назад
You Are Good!
@jizanthapus176
@jizanthapus176 3 года назад
Many thanks.
@aycayigit9582
@aycayigit9582 5 лет назад
May you explain other problems of synchronization, it would be really great!
@乔五
@乔五 3 года назад
Thank you very much! Appreciate!
@jaimelannister9933
@jaimelannister9933 4 года назад
I really liked it. Good!
@khaled7370
@khaled7370 4 года назад
thank you a lot prof.
@emmayin6822
@emmayin6822 6 лет назад
great videos! can you please make a video about semaphore? thanks!
@binarywisdom4501
@binarywisdom4501 6 лет назад
Thank you. The rest is a part of the online "course" that can be found at binary-wisdom.teachable.com/p/quick-explanations-for-the-operating-systems-course/
@sheriffola
@sheriffola 6 лет назад
Great explanation!
@binarywisdom4501
@binarywisdom4501 6 лет назад
Thank you
@andreialopes3166
@andreialopes3166 4 года назад
What's the difference between using only one producer and several producers?
@binarywisdom4501
@binarywisdom4501 4 года назад
More complex synchronization is needed. You got to handle not only producer-consumer synchronization but also make sure that multiple producers or multiple consumers don't conflict between themselves.
@bubblesgrappling736
@bubblesgrappling736 4 года назад
the semiphors video, where can I find it?
@Teslacoil33
@Teslacoil33 5 лет назад
Can somebody explain why using mutual exclusion will not work in the Producers & Consumers problem?
@binarywisdom4501
@binarywisdom4501 5 лет назад
You can make it work, though it wouldn't be so elegant. Semaphores are the solution from one of the most popular college textbooks on Operating Systems. If you want to use something like mutexes, you can but don't try to lock the whole buffer with it. It would be very inefficient.
@PedritoLima73
@PedritoLima73 6 лет назад
good explanation
@binarywisdom4501
@binarywisdom4501 5 лет назад
Thank you
@umarsadiqibrahim
@umarsadiqibrahim 4 года назад
Good Video
@OlliS71
@OlliS71 8 месяцев назад
Use a deque and there's no full condition.
@austinleestudent94
@austinleestudent94 3 года назад
You did not include the necessary mutex to ensure mutual exclusion between the consumer and the producer. This is not a complete explanation.
@binarywisdom4501
@binarywisdom4501 3 года назад
All the necessary synchronization is in place here. You don't need any special mutexes for this version of the problem (single producer and single consumer). Try to come up with a scenario that causes a mistake and you'll see how it works like that.
Далее
Producer - Consumer Problem in Multi-Threading
25:18
Просмотров 113 тыс.
Cheese grater HACK
00:22
Просмотров 1 млн
Dining Philosophers Problem with Solution
8:10
Просмотров 79 тыс.
Semaphores
22:51
Просмотров 474 тыс.
Synchronization 3: Producer/Consumer Problem
24:25
Просмотров 37 тыс.
The Bounded Buffer Problem
15:48
Просмотров 284 тыс.
A Simple Guide to "The Sleeping Barber" Problem
6:11
Everything Starts with a Note-taking System
21:23
Просмотров 254 тыс.