How does swap instruction handles concurrency in operating system?
How does this algorithm achieves mutual exclusion, progress and bounded waiting if it does?
I realize this is not something simple. I actually have a video course for this which is in Hindi but I am not understanding the concept at all.
[code]
do
{
key=true;
while(key==true)
{
swap(&lock,&key);
}
critical section
lock=false;
Remainder Section
}while(true);
void swap(boolean *a, boolean *b)
{
boolean temp=*a;
*a=*b;
*b=temp;
}
[/code]
How do I prove if it satisfied mutual exclusion, progress and bounded waiting?