I came across a code with following condition
(number[i],i)<(number[j],j)
Can someone tell what does this condition mean or checks?
i,j are variables and number is array
Here is the whole code-
do{
choosing[i]=true;
number[i]=max(mumber[0],number[1],...,number[n-1])+1;
choosing[i]=false;
for(j=0;j<n;j++){
while(choosing[j]);
while((number[j]!=0)&&(number[j],j)<(number[i],i));}
critical section
number[i]=0;}while(1);
It was a critical section problem in multiple processes. Initialisations-
bool choosing[n];
int number[n];
This is what the book wrote about the condition-