Let say we have an atomic function Compare-and-Swap:
CSW(a,b,c)<
if (a==c){
c = b; return 0;
}else { a = c; return 1;}>
How do we use this CSW(a,b,c) to develop a solution to the critical section problem for n threads?
Thank you
CSW(a,b,c)<
if (a==c){
c = b; return 0;
}else { a = c; return 1;}>
How do we use this CSW(a,b,c) to develop a solution to the critical section problem for n threads?
Thank you