is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
We will have 2 mutexes (m1, m2) and 2 Threads (T1, T2)
- pandaasis11 June 25, 2021Initialize m1 =1(since we intend to start T1 first ) and b=0.
T1's resources are A1, A2, A3,...
T2's resources are B1, B2, B3,...
T1
while(1){
1. wait(m1)
2. prints (item from T1's resources) // prints A1, A2
3. signal(m2)
}
T2
while(1){
4 wait(m2)
5. prints (item from T2's resources) // prints B1, B2
6. signal(m1)
}
Step 4 in T2 gets blocked until step 3 in T1 is executed and step 1 in T1 gets blocked until step 6 in T2 is executed. which ensures that both the threads are waiting to print 1 element each alternatively.
For the 1st time, step 1 in T1 runs as m1 = 1.
Mutual Exlcusion, Progress and Bounded waiting is guarenteed by this process.