I can tell I have watched about 18 times Aspirants
@shrishti99972 жыл бұрын
Sir you told in your previous lectures that if wait(S) and signa(S)l function are used without preemption then mutual exclusion will always be present there. But in your question 3, the code that you have done from process P1 to P9 did not use mutual exclusion anywhere. Because whenever a wait(S) Function decrements the initial value of S of P1 in the critical section and then signal(S) increments it by 1, why should we execute P10 first?
@jeeera89022 жыл бұрын
because there we not know which process run first in the question it was not written we should start with p1 is mandatory
@dipanshusharma5529 Жыл бұрын
we want to maximize S , so that maximum number of processes can enter in critical section. This can be done when p10 is executed first and S is incremented twice.
@vasu12278 Жыл бұрын
guru ji ki jai ho
@vikas44072 жыл бұрын
Sir, In the last question all process will go into the critical section because when the p10 is execute in C. S. Section then value of S=3 , after we execute p1 ( wait decrease the value by one and also signal can increase the value by one) so it will give 3 and again repeat. Sir can u tell me this upper can true or false?
@akashjoshi49672 жыл бұрын
question is maximum number of process that can access the cs "together " . Together means they all have to be in the CS so semaphore will become 0 when 3 process together access the CS
@ayapnaga7627 Жыл бұрын
Yes, if we ignore the question than all the processes (i.e., p1 to p10 ) can be inside the critical section but the question said "all the processes to be executed only once" so, processes p1 to p10 can go inside CS and after coming out of the CS the processes cannot enter the CS as per the constraints given in the questions. so when p1 is inside the CS (S = 0), p10 can also get into CS too which makes S = 1, means other processes can also get into the CS . say p2 enters the CS and makes S = 0, now p10 moves out from CS making S = 1 again and here again p10 leaves a room for other processes to enter the CS so say p3 enters the CS and makes S = 0. Now no other processes can enter a CS because S = 0 and p10 cannot enter the CS to make S = 1 again because questions says "processes can enter CS only once.
@pramodkoushiktr18952 жыл бұрын
does S means max. # processes that can be in critical section together?
@theroastingstation2 жыл бұрын
S means semaphore only
@coderpriyabrat35853 жыл бұрын
superb
@itsmeakash_2 жыл бұрын
41:22 ☠☠
@rachnapanigrahi139 Жыл бұрын
Can anyone correct me if I'm wrong so Counting Semaphore is used in threads for mutual exclusion??
@the_truth_of_society Жыл бұрын
no....binary semaphores.....if you use counting semaphores in threads then more than one thread will enter into the critical section which will lead to data inconsistency .
@rachnapanigrahi139 Жыл бұрын
@@the_truth_of_society yeah yeah got it thank you
@a_36_devjyotisinha992 жыл бұрын
35:39
@vinayaksingh69593 жыл бұрын
28:43 is funny af 😂😂😂😂
@adityaratan1792 ай бұрын
19:45
@PIYUSHSHARMA-ql3uz4 ай бұрын
22:51 23:30
@kheersagarpatel31953 жыл бұрын
yes sir success
@parakhindustries3 жыл бұрын
Sir , Process P10 contains while loop while(true){ signal(s) C.S. signal(s) } while loop may execute for more than one time because the condition is always true and in question it is given than process run only once but process itself contains loop means we can maximize semaphore to any big value like 13 by running loop for 6 times and then we preempt p10 and then we can have all the remaining 9 processes in the critical section . in this way we can have all 10 process into C.S. while running all the processes only once . if correct answer is 3 , then inside the code there should not be while(true) statement if all processes is like these ( without while loop): p1....p9 p10 wait(s) signal(s) C.S. C.S. signal(s) signal(s) in these case we can say that answer is 3 . Please clear these doubt .
@saurabhtiwari2873 жыл бұрын
Bhai while ko ek se jayada baar kyo run kr rhe ho. While ek baar run hoga or s ki value ko 3 set kr dega.
@parakhindustries3 жыл бұрын
@@saurabhtiwari287 why while loop only run for only one time as it has condition true , it means that it can run for many times until that process is preempted or terminated ? it is not mentioned in the question that we have to run the while loop for only one time .
@saurabhtiwari2873 жыл бұрын
@@parakhindustries yes ur right sir. And u have written it is not mentioned in the question that while loop run only once. Sir I suggest u to plse once again read the q very carefully. In the q it clearly say that one process execute only one time. Toh isme while bhi ek hi baar chalega na sir. Aap loop kitni bhi baar chala skte ho. Lekin q ke hisab se toh while ek hi baar chalega na
@saurabhtiwari2873 жыл бұрын
And sir abhi bhi smjh me nhi aaya toh plse aap video dobara dekho
@parakhindustries3 жыл бұрын
@@saurabhtiwari287 Are bhai que me likha h process ek hi baar run hoga par process ke andar jo loop h wo to ek bar run hoga esa nhi likha h . aap que dekho.... agar aap C program me koi loop ko implement karoge aur run karoge to uski ek hi process create hogi aur loop multiple time run hoga na . har ek iteration ke liye alag process thodi banega bhai.
@ROHITKUMAR-lh4oi3 жыл бұрын
❤️❤️🔥🔥
@mohdadil28752 жыл бұрын
yes
@prernapriya86993 жыл бұрын
Why we use semphore solution if Peterson solutions fulfill the condition of CS problem..
@neerajcheryala96023 жыл бұрын
Because Counting semaphore additionally lets us to manage shared resources among multiple processes but not just two.
@subramanianvijayakumar49993 жыл бұрын
Peterson solution cannot be used in modern computers as most compilers now rearrange independent instructions which makes it ineffective. You can refer Silberschatz for more precise explanation.
@vishalcseiitghy3 жыл бұрын
@@subramanianvijayakumar4999 Bhai Galvin bhi bol sakta tha.Faltu ka Google karwa diya