For Students
Sunday, 11 March 2012
Mutual Exclusion with Swap
Shared data (initialized to
false
):
boolean
lock;
boolean
waiting[n];
Process
P
i
do {
key = true;
while (key == true)
Swap(
lock,key
);
critical section
lock = false;
remainder section
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment