hi,
The protocol used for protecting global data is using a semphore,.
the standard protocol says:
//
assuming 'a' is a global variable

down(&my_sem);

a++;

up(&my_sem);

//

now if in other thread i do not follow the protocol of acquiring a lock
before access to the global variable and simply write
//
//no lock acquired here

a--;

//no lock released here
//

Is atomicity lost?
will the global variable 'a' be decremented?
Is the consistency lost?
What happens if someone does not follow the standard protocol as in the
example above?

cheers,
Nikhil

Reply via email to