Dude, i actually struggled to understand the usage and application of a semaphore through the slides of my engineering course, but after watching your toilet example, i finally understand. Thank you so much, you are the professor we don't deserve, but the professor we need.
@BK69XXX
2 жыл бұрын
I failed my intial exams of previous semester and then i started learning Data structure from your playlist and socred almost full marks in terminal exam. Now for OS i daily watch two or three videos and lectures are very addictive, sometimes i spend entire weekend on youtube learning for your videos.
@GateSmashers
2 жыл бұрын
Keep learning and achieving
@abhinavbest2553
Жыл бұрын
jobless
@rishidangi2978
4 ай бұрын
kinda nerd
@youthoob3573
19 күн бұрын
@rishidangi2978 and you're kinda losser
@tanyadixit8257
2 жыл бұрын
During exams my entire college only remembers one name: Gatesmashers. You are really the teacher and guide our college professors (whom we pay) couldn't be. Thank you so much for providing such valuable content free of cost :)
@snigdhasinha3120
5 жыл бұрын
U r amazing .....far better than our faculty....👌👌👍 keep going
@ganeshborse8154
4 жыл бұрын
It right
@gouthamir1807
4 жыл бұрын
exactly
@achyutkumarsingh7308
3 жыл бұрын
The best comment i ever read😂😂😂😂
@sonianarendramodi2605
3 жыл бұрын
@@achyutkumarsingh7308 flirting ,lol
@souravrajmaitra2069
3 жыл бұрын
Strongly agree
@roshannayak1463
3 жыл бұрын
Finally, I can confidently tell that I have understood this topic!! Loved it!!
@imprakrut
6 жыл бұрын
Are you also watching this 1 day before your exam?
@geshudsouza3646
5 жыл бұрын
Yaaa
@MahbuburRahman-uc7np
5 жыл бұрын
me too
@shyamkachhadiya4964
5 жыл бұрын
yes XD
@srihariyallala407
5 жыл бұрын
Haaa
@Ash-ch9ws
5 жыл бұрын
Hm
@sajib.khan99
3 жыл бұрын
Your teaching ability is more capable than some of our university faculty.
@programminglovers2682
3 жыл бұрын
True
@nirbhaibaran5620
3 жыл бұрын
Perfect comment for him 👍👍
@manavgupta272
2 жыл бұрын
some ??
@fiboXO
Жыл бұрын
frfr
@rasmitasahoo8836
Жыл бұрын
💯
@AyushMo
3 жыл бұрын
Yaar ek baat samajh nhi aayi, khali 440k subscriber kaise hai ab tak. Poore youtube pei aur koi operating system aur koi nahi padhaya aise. Deserves more support. Freakin Fantastic, thanks a ton for the course!
@GateSmashers
3 жыл бұрын
Wow..thank u..jaldi ho jayenge million
@hiteshbansal4878
3 жыл бұрын
@@GateSmashers I have a doubt, when process (P4) waking up from the block state and there is already some space created in critical section as one process(P1) have come outside, and also the P4 has already run the entry level code uptill the suspend was called and should resume after that(also the value of S is decreased already one time), so it should go to critical section directly resuming from that line but as you said in video it is running again entry code, why? Please Reply And Thank you for these amazing videos
@prasadprojects
3 жыл бұрын
@@hiteshbansal4878 Any process to enter into critical section have to execute the entry code and exit code, even the process is from wake up() state (blocking state) like P4, P5 ....or the new process like P6, P7, P8, .... so it should not directly go to critical section, as discussed in video it is running again entry code.....
@priyamraj7548
3 жыл бұрын
@@hiteshbansal4878 Yeah bro, it should not execute the entry code again but rather enter the Critical Section directly
@AyushMo
3 жыл бұрын
Maine ek aur jageh yeh comment post kia tha, toh yaha pe paste kar rha hu in case you're still struggling or for anyone who doesn't understand it in the future: Reposting a comment from 9 months ago that went unanswered: "sir in 18:23 p4 try karta hi enter karane ke liye then s.value -1 hoti hi ...assume karo wo dobara suspend ho jata hi aur p3 exit code chalata hi to uske baad s. value =0 hogi ..phir iske baad to koi process critical section mei ni hoga ...aur koi next process agar aata hi to s. value negative hoti jayegi , aise case mei to koi andar ni jaa payegaa, humeshaa suspend hote rahengey..pls provide solution" Another comment in English: "what if value of S = 1 and one process entered in CS, value of S becomes 0, Now 50 process try to enter but they get blocked, Now value of S becomes -50, one process which was in CS now come out of CS, value of S becomes -49, now how another process entered in CS" I have the same doubt. From what I've understood, there a couple of things that are therefore incorrect. First off, whenever a process comes back from block list, it doesn't restart its execution of Down(), it would rather resume where it left off from, ie last line of if block. So secondly, this means that the code should actually be 'return;' instead of ' else { return; } ' so that it can actually resume its execution and enter into the critical state. Edit: Actually, I'm watching this again 4 months later. Perhaps you don't need to make the code change. The code is perhaps right, the explanation was wrong. So yes, whenever a process comes back from block list, it doesn't restart its execution of Down() like I said earlier. It continues from where it left indeed. And it left at a place where there's nothing left to execute(There's nothing after if else), so it's done executing Down() and can now enter the critical section. So the code as it is right now is correct, just the explanation that went with it was a little flawed.
@saadrehman3156
3 жыл бұрын
I can only say YOU are a true GEM personality, none of the KZitemrs, even our faculty staff in uni are not as good as YOU are Sir. Much appreciated and lots of love from Pakistan
@imrankhanfanclub3763
2 жыл бұрын
Aray saad bahi
@noobcharisma3807
3 жыл бұрын
Your teaching skills are amazing, you convey us the concept in 5 mins which our teachers do in 1.5 hours and we still don't understand them. Love from Pakistan
@amanbhadani8840
2 жыл бұрын
Happy to see that u guys are having a pen in your hand not a weapon.
@jashanpreetsingh6056
2 жыл бұрын
@@amanbhadani8840 great thinking ...sir
@zakriarehman8014
2 жыл бұрын
I wish you could teach us face to face in University. Totally in love with your teaching skills and knowledge transfer. Love from Pakistan.
@ayushjindal4981
4 жыл бұрын
Please dont delete this OS series ever from youtube. I am not making notes expecting that I can access these videos anytime in future..
@vivekranjan1477
2 жыл бұрын
sabas
@CricketFan_Krishna
4 жыл бұрын
mine faculty is like complicating everything and you sir simplicity at next level ...
@Engineerblogbihar
3 жыл бұрын
watch my video also for this topic
@rashikasharma9199
6 жыл бұрын
Sir you are an Amazing teacher 🙏👌all doubts are cleared now..
@vishnuSharma-lu1wk
6 жыл бұрын
great sir
@soumyadeepbarik5711
2 жыл бұрын
you are looking very pretty
@vivekranjan1477
2 жыл бұрын
@@soumyadeepbarik5711 well done
@shoaib_388
2 жыл бұрын
i can understand only your videos to mark scores in my academic yr ,,,may god give you long life and safe your family from problems and disease
@kartikpurohit7457
5 жыл бұрын
Sir aapne semaphores ko ittna clearly explain kiya jisse classical problems bohat ache se samaj aayi iske liye sir thanku so much aapke padaane ka tarika bohat acha hai
@aliyazdan4577
2 жыл бұрын
I have a big job interview next week and I need to cover all this stuff I studied 7 years ago. Your videos have been so helpful buddy, thanks a lot 😊
@namangupta4190
4 ай бұрын
kaisa gaya interview?
@saurabhrana4276
3 жыл бұрын
went through few comments....people are watching this video 1 day before exam,mean while me watching this video during exam... #covid19 thank you sir..!!
@insideentrepreneur7904
4 жыл бұрын
If I own a college and I have to select only one teacher, it will be Varun Singla. Huge respect sir!!!
@aakankshasharma4346
4 жыл бұрын
U are best sir... Aj se phle kbhi process synchronization , semaphore kbhi smjh nahi aaya, but apki video dekhne k bad crystal clear ho gya concept
@ShubhamGhuleCodes
3 жыл бұрын
Correction: 15:58 When P4 wakes up it can directly enter the critical section because it has already executed the entry section code ! Thank you for this wonderful lecture series ❤️
@ita755khushalkoli2
3 жыл бұрын
I had some doubts about it but I Advice you to solve an example.
@suryasikharej8116
3 жыл бұрын
if you read about multi threading you will see that when a thread is running and wait() is called and after waiting the thread does not directly jump to running state. The thread scheduler(program which decides which thread to run) decides when the thread will run again. Mean while all the operations done by the thread before calling wait() is saved.
@utkarshgangwar2173
3 жыл бұрын
@@suryasikharej8116 take 2 processes p1 and p2, suppose p1 comes first and executes down() (take s = 1 initially) means s will become 0 (1-1), now suppose while p1 is in cs , p2 wants to execute down(), where s will become -1(0-1), so 'if' will run for p2 and p2 will get blocked, now suppose p1 completes it's cs and executes up() where s will become 0(-1+1), means 'if' will run and p2 will get wake up but s is currently 0 means if according to sir that p2 will again check down() which means s will become -1(0-1), so in that case 'if' will run means p2 will again get blocked , so in this way p2 will starve, am i right ? or p2 will not execute down() from starting , will it resume after the sleep() call where then it will get the access to cs ? just clear this doubt
@suryasikharej8116
3 жыл бұрын
@@utkarshgangwar2173 You are using binary or counting in your example?
@suryasikharej8116
3 жыл бұрын
p2 will execute down and will go to a list which contains process which are waiting to execute cs. After p1 completes cs and while doing up() it will take one process(lets say p2) from the waiting list and start its exeution .
@sameerahmed3033
4 жыл бұрын
Perfect example of a Best Teacher
@dnariankajol3542
5 жыл бұрын
just amazing...very easy to understand when i see ur lecture. thq so much....
@mabbrarsaif7534
2 жыл бұрын
Sir YOU are the best teacher i have ever seen , such a clear cut explaination.Thank you Sir
@YasirAli-ow5zt
5 жыл бұрын
Sir Varunn you are great.... I am natuical officer.... nd i love to learn computer ... i have learnt many things from u... ur videos very help full.... ur videos are exam nights last hope....
@GateSmashers
5 жыл бұрын
Haha.. Thank you so much..
@anjalimuchhala4954
3 жыл бұрын
Sir you are such a great teacher and your teaching technique also best........thank you so much sir🙏
@aryaaryaa4216
3 жыл бұрын
woah mind blowing explanation. I'm from non-IT branch but i have started loving all your tutorials.. u have made this subject easy. Thank you so much sir More power to you.
@vishalsnsingh
3 жыл бұрын
I see half of video and all concept got clear!🙏🙏
@naeemaibrahim1645
3 жыл бұрын
YOU ARE THE DEFINITION OF A GOOD TUTOR I SWEARRRR
@divyashivpandey7750
4 жыл бұрын
Your videos are really great and easy to understand. They develop a very clear and organized view of the topic enabling student to grasp and gain command on it. As a student the only problem i faced while watching your videos was revision of the topic. For this student has to watch the whole video again (which is not always possible). If possible, you can add a revision notes to each video which covers the topic and are meant for revision purpose. This would not only enhance the content of your channel (which would also promote your channel when students will share notes among them) but also provide students with good study content. Thank you.
@shivamkhare9472
2 жыл бұрын
after watchig your videos my confidence on this on this subject is increased thank you sir your way of explanation is vary easy
@prithwi1820
2 жыл бұрын
Amazing explanation....after watching your video it is clear to me...
@VishalYadav-gk1kg
9 ай бұрын
Very Nice Explanation Sir, Thank you !
@amandwivedi5644
5 жыл бұрын
We love you sir..You are a good teacher at all. Keep doing it sir. May god keep you alwz happy and healthy.
@smritipradhan6921
3 жыл бұрын
Thank you for providing industry level education for free.That too such a great course free is the best thing one can avail.
@ishanpand3y
5 жыл бұрын
I wish you were my professor in my college ☺️😅. You are just amazing as teacher 🤩😍
@sgr2683
2 жыл бұрын
so true.
@abhaydwivedi6354
5 жыл бұрын
This is the best explanation in KZitem
@AyushMo
3 жыл бұрын
Reposting a comment from 9 months ago that went unanswered: "sir in 18:23 p4 try karta hi enter karane ke liye then s.value -1 hoti hi ...assume karo wo dobara suspend ho jata hi aur p3 exit code chalata hi to uske baad s. value =0 hogi ..phir iske baad to koi process critical section mei ni hoga ...aur koi next process agar aata hi to s. value negative hoti jayegi , aise case mei to koi andar ni jaa payegaa, humeshaa suspend hote rahengey..pls provide solution" Another comment in English: "what if value of S = 1 and one process entered in CS, value of S becomes 0, Now 50 process try to enter but they get blocked, Now value of S becomes -50, one process which was in CS now come out of CS, value of S becomes -49, now how another process entered in CS" I have the same doubt. From what I've understood, there a couple of things that are therefore incorrect. First off, whenever a process comes back from block list, it doesn't restart its execution of Down(), it would rather resume where it left off from, ie last line of if block. So secondly, this means that the code should actually be 'return;' instead of ' else { return; } ' so that it can actually resume its execution and enter into the critical state. Do correct me if I'm wrong @Gate Smashers
@sanyatayal6933
3 жыл бұрын
Understood now. This is actually helpful.. have been trying to find this out for a long time actually. Thanks!
@AyushMo
3 жыл бұрын
glad it helps.
@suryasikharej8116
3 жыл бұрын
no a process can never directly go to the running state. The long term scheduler will decide which process to put from the new queue to the ready queue.
@AyushMo
3 жыл бұрын
No-one talked about 'directly going to the running state'.. It was a comment on the point of resumption of execution of a process when it comes back from the block list.
@AyushMo
3 жыл бұрын
Actually, I'm watching this again 4 months later. Perhaps you don't need to make the code change. The code is perhaps right, the explanation was wrong. So yes, whenever a process comes back from block list, it doesn't restart its execution of Down() like I said earlier. It continues from where it left indeed. And it left at a place where there's nothing left to execute(There's nothing after if else), so it's done executing Down() and can now enter the critical section. So the code as it is right now is correct, just the explanation that went with it was a little flawed.
@priyankadeka8603
4 ай бұрын
When we have a teacher like him on youtube then it is so easy for distance students. Thank u so much sir❤
@Er.meghajain
6 жыл бұрын
Thanks I had too much confusion on this topic but now cleared
@goldyhandsome3267
2 жыл бұрын
aap ka chahra bhut cute he positive vibes and 25 ke 25 min sun ne me dikkat nahi hoti
@onmywaytopassion5382
3 жыл бұрын
So thankful, so easy to understand by your teaching❤
@afsha.fahm0910
5 жыл бұрын
First time i got this concept .Truly amazing Sir!
@vivekranjan1477
2 жыл бұрын
thanks
@devanshmesson2777
2 жыл бұрын
I have a doubt, If S=3, which means, Critical section is capable of having 3 processes inside. Now, 5 processes executes the wait() operation, Now, S = -2, and 3 processes (P1,P2,P3) are already inside the CS. Now, as we know, critical section is capable of having 3 processes, so if P1 exits the CS (Now, S= -1), there are currently 2 processes in the CS, which means, One process must enter the CS, but because S=-1 it cannot enter. So, In order to make P4 enter the CS, one more process should exit the CS, so that S is positive, which is something illogical.Suppose P2 also exits CS. Now S=0. Now if P4 enters the CS, P5 cannot enter the CS now because S becomes -1 after P4 entered. CS has a space of one process but p5 cannot enter. I am not able to understand Counting Semaphore concept! Can anybody explain?
@niranjansaha5135
Жыл бұрын
As per my understanding the process would resume after waking up from sleep so they won't run the Down() function again, they shall enter to the critical section only when the Semaphore value is greater than 1,, there would be a infinite while sloop kind scenery ig,,,,,,,, I came up with this explanation myself just to statisfy my thrust to meet the inconsistency in the video,,, please correct me if you find more suitable ans ..
@adityasankhla1433
Жыл бұрын
@@niranjansaha5135 Yep, I too think that should be it. It is very weird how only a handful on comments are pointing out this obvious mistake.
@rushabhlegion2560
Жыл бұрын
Damn, same doubt. There are hundreds of students hailing this video but not able to get this doubt. Can you tell me from where to understand this concept?
@satwikjain6455
Жыл бұрын
@@adityasankhla1433 ++
@harshiniadusumilli2509
3 жыл бұрын
U r awesome sir,understood the topic very well and now I am ready to answer all the questions from this topic....Thank you sir
@ayushigoyal6853
3 жыл бұрын
These vedio lecture series are really helpful.. I m following them for OS,CD.. And will follow for many more.. These lectures are responsible for completing my syllabus on time.. Thank you sir
@supriyakumari7279
4 жыл бұрын
Sir your lecture is too good .your teaching style is very impressive .
@arpitsaxena5972
4 жыл бұрын
Always prefer Gate smashers for my semesters related computer subjects♥️♥️♥️♥️🔥🔥🔥 love your explanation 🔥🔥🔥
@RohitMishra-ox6oy
4 жыл бұрын
I challenge in the whole KZitem u r the best teacher i have come through 🔥
@satvikkhare1844
3 жыл бұрын
well then you watching only Indian youtube.
@noorulain8463
3 жыл бұрын
a lot of appreciation from Pakistan :*
@khan_sir_comedy_videos8221
7 ай бұрын
You are the best teacher.
@MrJ84130
2 жыл бұрын
Hello Sir, I was not able to grasp the concepts of Operating system, but after seeing your videos, I'm able to understand very easily. Thank you very much for your efforts in helping us understand concepts very easily. I had a question: Does counting semaphore provide mutual exclusion? Because I saw many processes are entering the critical section simultaneously. And providing mutual exclusion is a necessity for process synchronization.
@Mrsarchanaharish
Жыл бұрын
At the start, 3 processes [P1,P2,P3] could get into the CS , since counting semaphore of 3 allows for exactly 3 processes to come and use the resources in CS [say there are 3 printers available]. P4 and P5 go to wait and semaphore becomes -2. Agreed. But when P1 comes out of CS, it means, semaphore became -1 as well as 1 printer became available. So, one of the waiting processes [may be P4] should come out of the wait and exit down() and should enter the CS. Now, P2,P3 and P4 shall be in CS - again 3 processes in CS, as per the allowance by the counting semaphore. Also, now the semaphore value is -1 , which indicates that just 1 process [P5] is waiting in the suspended state. So, when a process comes out of down() it should have acquired a count on the semaphore and would directly enter the CS. This is the correct explanation of the code here.
@xd69_naruto
5 ай бұрын
Exam Tomorrow at 11:30 AM , watching now at 10:45 PM
@sameenqamar6978
4 жыл бұрын
Thank u Sir... You are great.. All doubts clear.. lots of love from Pakistan
@nicholasgaming5711
4 жыл бұрын
This channel is Amazing 😍😍😍
@The_rahman
2 жыл бұрын
Bhai tum topic boleto ham bahut maaze se sunnte hain. Hamara pora collage milayato bhi aapke barabar nahi hain. You are amazing 💥💥😎
@ashwindhuriya6598
3 жыл бұрын
sir consider if semaphore value is 1......if process P1 tries to enter critical section the S will become 0 and it will enter. Next if process P2 wants to enter S value will become -1 and it will go in suspended state . Now consider P1 is completed and it incremented S to 0 which will wake up P2 and will bring it to ready state,now if P2 again wants to enter critical section then S value is currently 0 so it will still go back to suspended state and P1 is also completed....please solve this doubt sir!
@AyushMo
3 жыл бұрын
Exactly, do comment back if you manage to find an answer to that.
@wasifrock687
2 жыл бұрын
nice observation
@muhsinmohamed7338
3 жыл бұрын
You are truly a saviour ❤️
@sumitshokeen8774
5 жыл бұрын
Thank u sir ji 🙏 way of explanation is lit🔥
@ShubhamSharma-ky2tf
Жыл бұрын
Thank you Varun Sir for explaining the complex concepts in such simple terms. Indebted to you for my interview preparation
@manmathkumarbhuyan6287
2 жыл бұрын
In critical section chapter, it is told that only one process can execute the critical section. But here it is told that more than one process can enter into the critical section even if there is another one.
@rem_x_ff
Жыл бұрын
same doubt. Help me to understand.
@madhu19993
Жыл бұрын
7:59 mutual exclusion doubt will clear at this point of time.
@machireddypalakondareddy9958
Жыл бұрын
a counting semaphore can allow multiple processes or threads to access the critical section, hence mutual exclusion is not guaranteed.
@machireddypalakondareddy9958
Жыл бұрын
@@madhu19993 mutual exclusion may or may not be achieved
@ShivamKendre-fc3su
4 жыл бұрын
You are great teacher. Your explanation is really very easy to understand to and very powerful that can't forgot the concept. Thank you so much
@GateSmashers
4 жыл бұрын
Thank you so much for your appreciation.. It really motivate us..
@mindbodyps
3 жыл бұрын
This is how teaching become fun
@ninjasmotivation
4 ай бұрын
very helpful video sir great work
@dvlsravya9100
3 жыл бұрын
Your videos are amazing. I have the following queries and would like to know the answers of them. 1. How mutual exclusion is satisfied in case of counting semaphores ? 2. Is there any difference between mutex and semaphore. Explain in detail, if any. 3. If S=1, p1 enters. P2,p3,p4 will be -1,-2,-3. And if p1 is moved out of Critical section with exit code. Semaphore value becomes -2, in such a case; the critical section is left idle as the CS is not utilised by any process. ? Can you explain this state in detail.
kzitem.info/news/bejne/pax8mXWpjZmdiIo --- check this out to understand difference between semaphore and mutex
@malakhan4003
Жыл бұрын
Ap bohat achy teacher Hain your teaching method is very good plzzz make more vedios.....
@shudderranz5919
4 ай бұрын
aapko 1.5x pe dekhne ki habit ho gyi hai jaise hi 1x pe video chalti hai bada funny lagta hai 😂
@Ruchi_pal123
29 күн бұрын
Seriously 😅😅😅
@bharatkanojiya537
4 жыл бұрын
nice expiation sir superb method i understand easily all concept thank your so much sir......
@silajitsaha3369
5 жыл бұрын
Sir, suppose initially s=1. Then p1 enter in CS(s=0) and then p2, p3 and p4 tries to enter in CS(s=-3) and then p1 exit(s=-2) now the CS is empty but still p2 cannot enter in CS why?????
@yogesh8275
4 жыл бұрын
Iska answer mila kya bhai ?
@roshan84ya99
4 жыл бұрын
@@yogesh8275 same question
@pratyushkumar3829
4 жыл бұрын
I guess because p2, p3 and p4 are in the waiting state (block state) and can only enter when s>0
@yogesh8275
4 жыл бұрын
There will be deadlock Coz we r try to awake the process which is not actually in sleep condition (for set the value of semaphore greater than one)
@sharmiladevi4012
3 жыл бұрын
As s value is less then 0 and when value is less than 0 its goes in sleep mode
@evendevilscry1431
5 жыл бұрын
Best explanation. The words you choose to speak and even a small bit of information is elaborated so nicely. Thank you
@nupurahluwalia6575
6 жыл бұрын
Very well explained Sir. Your videos are very helpful. :)
@keerthireddy6467
3 жыл бұрын
Sir..uh are simply superb...big fan of ur teaching sir...❤❤
@princekhatri88
11 ай бұрын
5 minutes before exam.
@Rahul-kw6zf
2 ай бұрын
Hum bhai exam me hi phone leke aaye😊
@user-gd3xp7gf9r
9 ай бұрын
Excellent Explanation Sir, but still cant get one thing, that in Lock Method, Test_and_Set Method and Strict Alteration Method our main aim was to achieve MUTUAL EXCLUSION, then why in Counting Semaphores we are allowing more than one Process in the Critical Section at same time..
@Vikashpoonia.ExamsABC
5 жыл бұрын
Dear Friend, If you can prepare series on Computer architecture and organization then plz prepare that. We would love to learn from your videos. God bless you.
@koushikjana849
4 жыл бұрын
Just amazing video Thank you sir Please upload practical in this topic
@kunjk23
3 жыл бұрын
One question here, won't decrementing or incrementing S in Down and Up result in race conditions as explained in previous videos? Which will lead to inconsistent value for S
@shabir301
2 жыл бұрын
Yes , i have also same confusion. Semaphore is also using critical section type code. This result is indeterministic state of program. Let take two process p1,p2. 1)Both performing down code , while sValue =1; means only one program can enter in CS. 2) process 1 : fetch sValue , decrement operation 1-1=0, but not store in ram , process preempted. 3) process 2: fetch (sValue ie 1), Decrement operation 1-1=0, and save to ram, and check s
@hemiacetal1331
2 жыл бұрын
Incrementing/Decrementing are atomic operations i.e., they either execute fully or don't execute at all. So, when more than 1 process will try to update the value of "s" then ultimately "s" will either be equal to 0 or 1.
@hammad8954
2 жыл бұрын
Bohot sahi samjhaye, keep up the good work
@soumyajitdey5720
5 жыл бұрын
What is the utility of counting semaphore if it does not follow mutual exclusion?
@palakgupta6804
5 жыл бұрын
Yes please clear this
@naveetakharb7647
5 жыл бұрын
I think....counting semaphore is used for synchronisation and binary semaphore is used for mutual exclusion.
@saptarshidas6971
4 жыл бұрын
@@naveetakharb7647 if you are using the word synchronisation then under synchronisation their is a condition Mutual exclusion According to you one is following synchronisation and other mutual exclusion is kind of absurd type of answer because if any algorithm is synchronised for multi processing that means that it is also following mutual exclusion because to achieve synchronisation you must achieve mutual exclusion as it is primary goal to obtain a synchronised algorithm for multi processing
@geshudsouza3646
5 жыл бұрын
Thank u so much sir .....i watch only the vedios which u upload and it helps me a lot and i watch it only one day before my exams but i score good marks....thank u sir
@OmitA25
6 жыл бұрын
awesome explantion.........plz make a vdeo on computer org.
@harshalkodgire766
2 жыл бұрын
Really Helpful video.. Thanks a lot sir ❤
@lalitsutharr
2 жыл бұрын
would you help in os
@priyeshagarwal2644
3 жыл бұрын
sir, I have a doubt. let's say S = 3, and 100 processes execute the down function. 3 processes P1,P2,P3 enter the critical section, and other 97 processes are in suspend list. Now S = -97, then only 3 processes can execute the up function (because only 3 are inside critical section), and only 3 out of those 97 processes will wake up. So, how will the other 94 processes wake up?
@kenseno5108
2 жыл бұрын
P1 exits critical section..execute UP function waking up P4, This means P1->critical section->Up->P4 P2->critical section->Up->P5 P3->critical section->Up->P6 P4->critical section->Up->P7 P5->critical section->Up->P8 .........And so so...
@naseershah6724
2 жыл бұрын
The example is only for understanding the function of Up and down function. Otherwise only one process is allowed to enter in the critical section. If more than one process enter in the critical section then it leads to deadlock or race condition.
@anujtalwar
2 жыл бұрын
@@kenseno5108 But when P1 exits and runs it's exit code, S becomes -99, correct? So when S is -99 and let's say P4 woke up, then P4 would try to execute down, right? So when you start executing down, first of all S becomes -100 once again when the first line is executed, and then because S is -100, which is less than 0, the if condition is true, so the process P4 again enters the sleep mode and does not get executed, ever. This happens with all the processes and S will never be able to reach positive side ever again or execute any critical sections even when the crit section is empty.
@rahulbajaj1560
2 жыл бұрын
@@anujtalwar same confusion..
@rishiraj1028
2 жыл бұрын
@@rahulbajaj1560 Same here...I guess that after a process wakes up, it will go directly into the critical section.
@faisalkhan1026
2 жыл бұрын
best lecture on semaphores, love and respect from Pakistan.
@reshmajannu1755
5 жыл бұрын
sir, how can a critical section handle more than one process(p1,p2,p3).it is supposed to run only one program at a time right?
@navagharkiran5769
4 жыл бұрын
its for an example when multiple process occurs at a time in general its one but in computer without ur knowledge a lot of processor at background work
@soumyapawar8125
4 жыл бұрын
There are some resources which can allow more than one processes to run it at a time
@neharaj3324
3 жыл бұрын
Is it supporting mutual exclusion?
@jaweriajalil8587
2 жыл бұрын
Really Useful Video. Thank You Sir and lots of Respect From Pakistan🙂
@tarunmnair
4 жыл бұрын
@14:41 when P1 comes out of CS, then P4 can enter CS but because semaphore S = -1, it is unable to enter. CS has provision for 3 tasks to enter simultaneously, then when P1 is finished, P4 can take its place? why does that not happen?
@sriharsha8802
4 жыл бұрын
I am also having the same doubt. If you got this doubt cleared can you explain to me, please?
@Lalit_Payal
4 жыл бұрын
P4p5 both are in not critical section they are just in ready queue
@riteshpandey5047
Жыл бұрын
wow wonderful explanation 🤗
@YasirAli-ow5zt
5 жыл бұрын
our teachers even suggests us ur videos here in pakistann ... lOv u sir
@shiladityamukherjee9590
3 жыл бұрын
pakistan mein CS padhte hai log?
@tanmaychandra9434
3 жыл бұрын
Best content bhaiya matlb itna accha hai ki like dena bhool gya tha and next video chalu hogya then back hokr aya 2 additional adds bhi face kia like and comment dene ke lia
@nikeshprasad5559
5 жыл бұрын
Sir, when S = 3, 3 processes can enter Critical Section and other processes running the wait() are put to block list. Now when a process exits the CS why can't we simply let a suspended process to enter critical section if it can allow 3 process?
@saravpreetsikka8152
4 жыл бұрын
Yes you are right, we will directly add that process from suspended list to critical section Sir explained it wrong, according to sir's explanation if at anytime 4 processes reached in the suspended list then no process can enter in critical section as semaphore value will be -4 and exit code of 3 processes can make it -1 which is less than 0, so no process can enter in the critical section
@sensei249
4 жыл бұрын
@@AshishKumar-zs3nk BHAI LOG KYA PUCH RHE VO TO PADH.
@crackielts4807
2 жыл бұрын
Outstanding information before one day exam
@deepikaagarwal5580
4 жыл бұрын
This counting semaphore can be achieved simply by using semaphore wait() and signal() operation. I found this code wrong as in the starting the value of S=3 means 3process can enter the critical section at a time but when they all exit only one process able to enter... Isn't it's illogical...
@harshrajput3547
4 жыл бұрын
exactly
@kamalpreetsingh2771
4 жыл бұрын
He did so just for explaining, semaphore is intialized with 1 always
@sriharsha8802
4 жыл бұрын
when a process p1 executes its signal operation, semaphore value becomes -1 and the resource which was released by p1 was given to p4 (which was in a blocked state) directly without any incrementation of the semaphore value. same for the p5. after assigning the resource to p5 the semaphore value is 0
@sriharsha8802
4 жыл бұрын
@@kamalpreetsingh2771 no, while using counting semaphore the value can be any integer value.
@AshishKumar-zs3nk
4 жыл бұрын
8:00
@sudeshmandan2637
4 жыл бұрын
Amazing way of teaching.. 👍
@vishalchauhan9832
5 жыл бұрын
Best explanation!
@Koushik__
10 ай бұрын
Sir, I Really appreciate your videos it is helping me a lot thank you, I have a doubt about what happens if a process gets preempted while executing the line S.value = S.value - 1; as you explained in the "Lock Variable" Concept??
@haiderzal
4 жыл бұрын
what if value of S = 1 and one process entered in CS, value of S becomes 0, Now 50 process try to enter but they get blocked, Now value of S becomes -50, one process which was in CS now come out of CS, value of S becomes -49, now how another process entered in CS?
@usamanadeem8504
4 жыл бұрын
great question I want its answer.
@usamanadeem8504
4 жыл бұрын
The processes are blocked. Others will not enter the critical section. 21:30 and the other process can enter in the CS, By calling up(), operation 50 times.
@ketangupta221
4 жыл бұрын
@@usamanadeem8504 process enters the CS by calling down operation and it will further decrease the S value So how does it helps But over suspension of proccess will block the CS for further use
@yogesh8275
4 жыл бұрын
Perhaps There will be deadlock Coz we r try to awake the process which is not actually in sleep condition (for set the value of semaphore greater than one)
@AyushMo
3 жыл бұрын
Exactly, did you figure out a solution to this?
@shashankjain4657
3 жыл бұрын
sir hum faltu hi cllg ki class krte hain kyuki smz to aapka hi ata hai......you are great sir
@NaveedAhmed-xp3nu
3 жыл бұрын
Sir ap ne entry section k through 3 process cs main enter karwae but according to rules sirf one process cs main hona chaye
Пікірлер: 1 М.