PDA

View Full Version : Good ole Semaphores.......



LeeMan101
04-03-2003, 04:12 PM
I'm taking an Operating Systems class and stuck on a problem with Semaphores.
Here it is:
Suppose a machine's instruction set includes an instruction named swap that operates as follows (as an indivisible instruction):

swap(boolean *a, boolean *b)
{
boolean t;
t = *a;
*a = *b;
*b = t;
}

Show how swap can be used to implement the p and v operations.

dP munky
04-03-2003, 04:18 PM
>>the p and v operations.
what?

i think this is a c/c++ board post...smells like homework

Govtcheez
04-03-2003, 04:23 PM
And a horrible worded one at that. Do your own homework.