About Operating Systems concepts
hi all
i have question about concurrency processing in operating systems concepts
suppose that we have two process A,B that running concurrently in a computer.
we have the following algorithm. (this is for A , for B replace a to b)
Code:
:retry
flag[a]=false;
if (flag[b] != false ) goto retry;
flag[a]=true;
if (flag[b] != false ) goto retry;
// critical section
flag[a]=false;
we know each ideal algorithm for critical section accessing must have three constraints : 1.mutual exclusion , 2.progress , 3.bounded waiting
my question is: for the above algorithm which of these constrain(s) have?
best regards...
Re: About Operating Systems concepts
Is this some kind of school task?
Re: About Operating Systems concepts
yes , this is a university assignment for course OS
i think this algorithm has not "Progress" constraint, but not sure!
by this algorithm the "Mutual Exclusion" has been met.
what about Progress cons. ??
thanks Mr Wysota
Re: About Operating Systems concepts
I'm sorry, we're not allowed to solve school tasks.
Re: About Operating Systems concepts
please suppose this is not a school task ! :D
just tell me this algorithm satisfy "Progress" or not ?
thanks Mr Wysota
Re: About Operating Systems concepts
You may also check the video to get basic idea of semaphore and shared resource.
https://www.youtube.com/watch?v=VQFJQJGmixM