Q61
MCQ2 marks, −0.5The atomic fetch-and-set instruction unconditionally sets the memory location to and fetches the old value of in without allowing any intervening access to the memory location . Consider the following implementation of and functions on a binary semaphore . void P (binary_semaphore *s) { unsigned y; unsigned *x = &(s->value); do { fetch-and-set x, y; } while (y); } void V (binary_semaphore *s) { S->value = 0; } Which one of the following is true?
Sign in to save attempts.
Loading…