To make the code a bit clearer, I would suggest renaming "empty" semaphore to "free_slots" and "full" semaphore to "taken_slots". Makes it easier to understand what this code does and to memorize the fact that wait() performs a decrement operation while signal() increments the value. Othervise quality lesson, as always. Thanks.
@harekrishna45842 жыл бұрын
our teacher recommends ur channel as she herself learns here lmaooo
@EnigmaAI-88 Жыл бұрын
😂😂😂
@yashaswininag3783 Жыл бұрын
Because it is recommended in VTU syllabus.. You people are unbelievable.. No gratitude towards anyone
@ChitragaarAshokaraju3 ай бұрын
Same
@Playtimetales6516 күн бұрын
Why show gratitude we are spending lakhs and they don't even know how to explain anything properly. So we end up referring channels on KZbin@@yashaswininag3783
@ChandanKSwain2 жыл бұрын
Explanation level is outstanding. It makes too easy to grasp...
@maanyamuthamma357710 ай бұрын
You deserve an award for doing this 🎉🎉
@aquadap219 Жыл бұрын
i watched the past 6 videos of process synchronization and theyre amazing videos thank you!
@rupambiswas9532 жыл бұрын
Thanks for saving my semester exam 🙏🙏💙💙
@mamathaav4627 Жыл бұрын
Your teaching method is really good.keep on going sir.😊
@ganesh_hulagur3 жыл бұрын
Bruh your videos are really help full Plzz do upload remaining topics like *The reader -writer problem *The Dining philosophers problems #monitors etc🙏
@adelgado07233 жыл бұрын
I think this is a version of the reader-writer problem
@lakshyakanjani23133 ай бұрын
Dekh le upload hogyi hai
@lakshyakanjani23133 ай бұрын
@@adelgado0723 ramayan khatam hogyi ye puchra ram ji kon the 🤦
@ghaziabadw34942 жыл бұрын
thank you so so much for saving me at this last moment
@erenmedia2336Ай бұрын
Thank you. You are a true savior.
@Irina-k2p3m26 күн бұрын
أمري ياوردة في الدار 🌷 يازهر الليلك يا غار🌷 توج قلبي حتى صار🌷 لك يأمي🌷 أمي مهما عمري طال🌷 بدعاها يرتاح البال 🌷أيام الخير شلال من رضى أمي 🌷
@jameysiddiqui69102 жыл бұрын
This is basic discussion which is good, please can you explain the scenario where producer and consumer can work in paralell.
@kayakMike10002 жыл бұрын
I don't think you really need semaphores and mutexes for this. The producer and consumer could be operating in parallel through some threading mechanism. Assuming there's only one consumer and one producer, we could have a read pointer "chase" the "writer" pointer. the consumer thread isn't allowed to change anything other than it's own read pointer, and we also assume that if the previous element in the buffer has already been consumed. If the consumer measures the read and write pointers to be identical, then the consumer doesn't use that value untill the write pointer is different. If the read and write pointers are different, the consumer consumes the data, then increments its read pointer to point at the next element in the buffer. Now the producer has a write pointer that will increment if the next element in the buffer is not where the read pointer is pointing to. The idea here is the read pointer always chases the write pointer, you could even do this with a ring buffer... With this scheme, the buffer is "empty" when everything has been read, and the read pointer and write pointer point at the same thing. The buffer is full if the write pointer can't advance because the next pointer is where the read pointer actually is..
@j4jeev678 Жыл бұрын
Just make 2 thread functions for each producer and consumer and then run both the threads and join it with main thread
@habibaadawi22 Жыл бұрын
u are a life saver . thank u so much sir
@TheEkimjeet2 жыл бұрын
great presentation and slides! love the content
@advithgowda620 Жыл бұрын
Brooo u r a life changer 😘
@zuhal6900 Жыл бұрын
That's what i've been looking for!!!! just perfect!!
@DrJALAGHARI3 жыл бұрын
A very good way of explanation. Keep it up.
@user-ytuser Жыл бұрын
thanks you explained an important topic in a easy manner
@codeWithNoComments29 күн бұрын
Binary Semaphore and Mutex are different. At 4:29 they are being used interchangeably. To preserve a critical section, semaphore must not be used. It should've been an actual Mutex.
@snehasharma3041 Жыл бұрын
Amazing explanation 🥹
@darshil-oh2le Жыл бұрын
Awesome explaination ✌✌
@adelgado07233 жыл бұрын
Thank you for the excellent content!
@EnigmaAI-88 Жыл бұрын
Great videos 💯
@baraaabuasal56263 жыл бұрын
i am an electrical engineer i dont know anything about cs but i saw the video, i clicked, i am now studying this problem with you and i understand everything. thank you but may i ask, what is this programming language?
@pranavvenkata4753 жыл бұрын
the language used for the implementation of the solution is C
@lakshyakanjani23133 ай бұрын
Thapu
@putrescentvermin2 жыл бұрын
This was basically my OS project.
@PythonisLove3 жыл бұрын
great content as always
@ith3r78 ай бұрын
Well explained !!
@ayahamad5931 Жыл бұрын
Thanks sir❤❤
@tasnimsart34303 жыл бұрын
Thanks so much
@arvinhipolito1572 жыл бұрын
One of the best explanation. Thank you very much
@liorlivyatan2 жыл бұрын
Why performing signal(mutex) before signal(full)? If a context switch happens in between, won't it cause problems?
@kayakMike10002 жыл бұрын
Why are they using mutexes and semaphores in the first place?
@-shultz Жыл бұрын
yeah , empty should be called before and then the lock must be released .
@kenzakhelkhal79312 жыл бұрын
Thank u so much it was very helpful appreciate ur efforts
@thegamingsoul8313 ай бұрын
Please call the mutex Locks by their name. mutex made that kinda confusing. 15:21
@Rachinter2 ай бұрын
Thank u
@mrymzrzr47412 жыл бұрын
Thank you was really helpful
@sarthakpal57953 ай бұрын
How are we keeping track of the index in which the producer and consumer will insert or consume item?
@aryansharma99332 жыл бұрын
Thank you!
@kayakMike10002 жыл бұрын
I don't think you really need mutex or semaphores if you only have one producer for one consumer...
@sanathkumarshenoy99553 жыл бұрын
Nice one
@Language_unlocked2 жыл бұрын
Thxxx sirr
@rasikannanl3476 Жыл бұрын
Fantastic
@bellaajaziz72043 жыл бұрын
can you please upload the remaining topics like deadlocks :)
@hmanmusic3908 Жыл бұрын
hi neso academy, a copyright thing is happening in our college. our college lecuturer is using your content by taking screen shots and using it to teach our classes. please raise a compliant and remove him from our college as fast as possible thanks in advance!
@hmanmusic3908 Жыл бұрын
😄
@hmanmusic3908 Жыл бұрын
your presentations are great keep it up!!
@farahmohamed2104 Жыл бұрын
precise
@marcustam4387 Жыл бұрын
I wonder if semaphores can solve this problem
@siddharthbhagat7637Ай бұрын
bro whats the value of mutex when locked and release
@FarmanOfficial7773 жыл бұрын
this is called teaching....
@pranavmuthige4272 жыл бұрын
Bhai Tu bhagwaan hai bhagwaan!!!
@modemharikumar92323 жыл бұрын
1st comment good lecture
@johndoe30923 жыл бұрын
Too many semaphores ! Can we do with just 1 ?
@michaelcenzoprano81733 жыл бұрын
i agree, you should only need a mutex lock. You can just maintain a count of elements in the buffer.
@brahamaggarwal18003 жыл бұрын
The thing is when you are dealing with multiple processes that are sharing data then simple if-else statements fail to synchronize our processes that's why it is necessary to use these many semaphores here.
@adityamishrasc2579 Жыл бұрын
🙏🙏🙏
@sricharan8575 Жыл бұрын
how semaphores solve bounded waiting since u said test.and.set.lock cant solve bounded waiting..coz new process may enter critica.sec while old one was preempted so called the unlucky process?????
@kswethakumari412 Жыл бұрын
I haven't listened anything before
@hombdr.pathakkshetri889310 ай бұрын
wawwwaaaaa
@satioOeinas Жыл бұрын
i dont think this is the correct implementation
@NireekshaKulali5 ай бұрын
Is this a false information??
@satioOeinas5 ай бұрын
@@NireekshaKulalinot necessarily false, but I think it’s incorrect