24.Conditional Variable in Producer-Consumer Problem - Windows System Programming in C/C++

preview_player
Показать описание
In This Tutorial
I have shown How to use CONDITIONAL_VARIABLE in Synchronization of Thread.

I am using conditional variable to solve the Producer-Consumer Problem.

Advantage of Conditional Variable over Mutex and Semaphore is:
1. They Consume Less Memory.
2. thread wait until particular condition met.
3. Better utilization of resources.

Following API Used:
1.InitializeConditionlaVariable
2.SleepConditionalVariableCS()
3. WakeConditionalVariable()
4.WakeAllConditionalVariable()

Video link
for thread:

for Critical Section

for More Information Visit
Рекомендации по теме
Комментарии
Автор

Gonna follow all of your videos from now on sir. Thanks a ton.

ismailrizvi
Автор

Nice videos sir !! I have one Question ->
Lets suppose producer produce item and consumer simultaneously consume it . Consumer don't wait till buffer full and then consume . Please suggest ?

anoopsharma
join shbcf.ru