Some computers have an instruction that atomically exchanges the values of two memorylocations. It is defined as follows:Exchange(int var1, int var2):⟨ int temp; temp = var1; var1 = var2; var2 = temp; ⟩Above, temp is an internal machine register.Using Exchange, dev elop a solution to the critical section problem. In particular, giv ecode forCSenter and CSexit protocols that use the shared lock variable declared below. Y our solutiondoes not have to be fair.shared variable: int lock = 0;CSenter:CSexit
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here