Does this method work if there is a single cpu that


Consider the following method by which an operating system might implement sema- phore instructions. Whenever the CPU is about to do an up or down on a semaphore (an integer variable in memory), it first sets the CPU priority or mask bits in such a way as to disable all interrupts. Then it fetches the semaphore, modifies it, and branches accordingly. Finally, it enables interrupts again. Does this method work if

a. There is a single CPU that switches between processes every 100 msec?

b. Two CPUs share a common memory in which the semaphore is located?

Solution Preview :

Prepared by a verified Expert
Operating System: Does this method work if there is a single cpu that
Reference No:- TGS01154905

Now Priced at $10 (50% Discount)

Recommended (93%)

Rated (4.5/5)