🎯 Overview
This simulation demonstrates Maekawa's algorithm for distributed mutual exclusion using quorum-based voting. Each participant must obtain votes from its quorum set (size √n) before accessing the critical section.
🔬 Experiment Cases to Try:
- Normal Operation: Request CS access with different participants to see the 3-phase protocol (REQUEST → REPLY → RELEASE)
- Quorum Intersection: Hover over nodes to see how each participant's quorum overlaps with others (ensuring mutual exclusion)
- Deadlock Scenario: Use "Simulate Deadlock" to see what happens when multiple participants request simultaneously and create circular waiting
- Different Network Sizes: Change participant count (4-16) to observe how quorum size √n affects the algorithm's behavior
- Message Complexity: Watch the logs to see exactly 3√n messages per critical section access
🖱️ Interactive Controls
🔧 Network Configuration:
- Participants Slider: Adjust the number of nodes (4-16)
- Quorum Size: Automatically calculated as √n
- Animation Speed: Control simulation speed (0.25x - 3x)
🔐 Critical Section Controls:
- Request CS Access: Selected participant requests critical section - watch the 3-phase protocol
- Release CS: Current owner releases critical section - triggers RELEASE messages
- Simulate Deadlock: Creates a realistic deadlock scenario with detailed explanation
- Reset System: Reset all participants to initial state
- Participant Selector: Choose which node requests access
🎨 Visual Legend
Available Node: Ready to participate in voting
Requesting CS: Sending requests to quorum members
Voting: Processing vote request from another node
In Critical Section: Currently accessing shared resource
Locked/Waiting: Involved in deadlock scenario
🔄 Algorithm Process
1
Request Phase: Participant sends REQUEST messages to all members in its quorum set
2
Voting Phase: Quorum members vote YES if they haven't voted for someone else, NO otherwise
3
Access Decision: If all quorum members vote YES, participant enters critical section
4
Release Phase: After completion, participant sends RELEASE messages to quorum members
📊 Statistics Panel
Monitor real-time metrics including:
- Active Participants: System health status
- Critical Section Status: Current owner and availability
- Request Details: Voting progress and timestamps
- Algorithm Metrics: Messages sent, entries, and deadlocks
🔧 Interactive Features
- Click on Nodes: View quorum membership
- Drag Nodes: Reposition participants in the visualization
- Animated Links: Follow message flow during quorum communication
- Real-time Logs: Track all algorithm events and decisions
⌨️ Keyboard Shortcuts
F1 Show/Hide this help
Ctrl + H Toggle help modal
Escape Close modal
R Reset simulation
🎓 Educational Notes
Quorum Properties: Each quorum set has size √n and any two quorum sets intersect in at least one node, ensuring mutual exclusion.
Deadlock Detection: Maekawa's algorithm can experience deadlocks. This simulation detects circular wait conditions and flags them as deadlocks.
Message Complexity: Each request requires exactly 3√n messages: √n REQUEST + √n REPLY + √n RELEASE messages.
Algorithm Properties: Satisfies ∀i ∀j : i ≠ j :: Ri ⋂ Rj ≠ ∅ (intersection property) and |Ri| = √N for optimal performance.