CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - Critical Section
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - Critical Section - List
[
Algorithm
]
Tokenringalgo
DL : 0
Token ring algorithm, using the concept of tokens to eliminate the problem of critical section ie preventing deadlock condition.
Date
: 2025-12-19
Size
: 1kb
User
:
dataminer
[
Algorithm
]
RICARTA-AGRAWALA--ALGORITHM
DL : 0
Also known an Ricart and Agrawala’s algorithm. • Nodes use logical clocks: all events are in total order. • When a node wants to enter a CS (Critical Section) it sends a message. • The message contains following information 1. Process id of the process 2. The name of CS that the process wants to enter 3. A unique timestamp generated by the process for request msg • When a node receives such a request 1. If it is not interested in this CS, it replies OK immediately. 2. If it is interested in this CS: If its message’s timestamp was older, then replies OK, Else, it puts the sender in a queue and doesn’t reply anything (yet) 3. If it is already in the CS, it puts the sender in a queue and doesn’t reply anything (yet). • A node enters the CS when it received OK from all other nodes. • A node that exits the CS, sends immediately OK to all nodes that it may have placed in the queue.-Also known an Ricart and Agrawala’s algorithm. • Nodes use logical clocks: all events are in total order. • When a node wants to enter a CS (Critical Section) it sends a message. • The message contains following information 1. Process id of the process 2. The name of CS that the process wants to enter 3. A unique timestamp generated by the process for request msg • When a node receives such a request 1. If it is not interested in this CS, it replies OK immediately. 2. If it is interested in this CS: If its message’s timestamp was older, then replies OK, Else, it puts the sender in a queue and doesn’t reply anything (yet) 3. If it is already in the CS, it puts the sender in a queue and doesn’t reply anything (yet). • A node enters the CS when it received OK from all other nodes. • A node that exits the CS, sends immediately OK to all nodes that it may have placed in the queue.
Date
: 2025-12-19
Size
: 1kb
User
:
mg
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.