Question: a) Implement a mutex lock using TestAndSet using busy waiting i-e. write pseudocode to implement each of the functions lock(m) and unlock (m) on a

a) Implement a mutex lock using TestAndSet using busy waiting i-e. write pseudocode to implement each of the functions lock(m) and unlock (m) on a boolean variable m (the mutex lock.) b) Why is an instruction like TestAndSet necessary? c) Does your solution have a bounded waiting time for the loc Why or why not? d) Describe how a binary semaphore can be implemented to guarantee fairness. e) When is a spin-lock (or busy waiting) acceptable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
