Skip to content

Commit 74b4940

Browse files
committed
🐛 with experiment details and simulation
1 parent 0786c6a commit 74b4940

File tree

16 files changed

+1190
-67
lines changed

16 files changed

+1190
-67
lines changed

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
## Introduction
1+
<div align="center">
2+
<img src="experiment/images/iiith-logo.png" width="25%">
3+
</div>
24

35

4-
<b>Discipline | <b>Fill your discipline name here
6+
### About the Experiment
7+
8+
<b>Discipline | <b>Computer Science and Engineering
59
:--|:--|
6-
<b> Lab | <b> Fill your lab name here
7-
<b> Experiment| <b> Fill your experiment name and number here
10+
<b> Lab | <b> Distributed Systems Virtual Lab
11+
<b> Experiment | <b> Lamport’s algorithm (6)
812

9-
### About the Experiment
1013

11-
Fill a brief description of this experiment here
14+
### Subject matter expert
1215

13-
<b>Name of Developer | <b> Fill the name of experiment owner here
16+
<b>Name of Developer | <b> Dr. Kishore Kothapalli
1417
:--|:--|
15-
<b> Institute | <b>
16-
<b> Email id| <b>
17-
<b> Department |
18+
<b> Institute | <b> IIIT Hyderabad
19+
<b> Email id | <b> [email protected]
20+
<b> Department | Computer Science and Engineering (Professor)
21+
<b> Website | [Faculty Page](https://faculty.iiit.ac.in/~kkishore/)
22+
1823

1924
### Contributors List
2025

2126
SrNo | Name | Faculty or Student | Department| Institute | Email id
2227
:--|:--|:--|:--|:--|:--|
23-
1 | . | . | . | . | .
24-
2 | . | . | . | . | .
28+
1 | Kishore Kothapalli | Professor | Computer Science and Engineering | IIIT Hyderabad | [email protected]
29+
2 | Subhajit Sahu | PhD Research Student | Computer Sceince and Enigneering | IIIT Hyderabad | [email protected]
30+
3 | Ajitanshu Singh | BTech Student | Computer Science and Engineering | IIIT Hyderabad | [email protected]

experiment-descriptor.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"unit-type": "lu",
3+
"label": "",
4+
"basedir": ".",
5+
"LaTeXinMD": true,
6+
"code-assessment": {
7+
"include": false,
8+
"languages": ["javascript"],
9+
"position": 5
10+
},
11+
"service-worker": "/path/to/service-worker.js",
12+
"units": [
13+
{
14+
"unit-type": "aim"
15+
},
16+
{
17+
"target": "theory.html",
18+
"source": "theory.md",
19+
"label": "Theory",
20+
"unit-type": "task",
21+
"content-type": "text"
22+
},
23+
{
24+
"target": "pretest.html",
25+
"source": "pretest.json",
26+
"label": "Pretest",
27+
"unit-type": "task",
28+
"content-type": "assesment"
29+
},
30+
{
31+
"target": "procedure.html",
32+
"source": "procedure.md",
33+
"label": "Procedure",
34+
"unit-type": "task",
35+
"content-type": "text"
36+
},
37+
{
38+
"target": "simulation.html",
39+
"source": "simulation/index.html",
40+
"label": "Simulation",
41+
"unit-type": "task",
42+
"content-type": "simulation"
43+
},
44+
{
45+
"target": "posttest.html",
46+
"source": "posttest.json",
47+
"label": "Posttest",
48+
"unit-type": "task",
49+
"content-type": "assesment"
50+
},
51+
{
52+
"target": "references.html",
53+
"source": "references.md",
54+
"label": "References",
55+
"unit-type": "task",
56+
"content-type": "text"
57+
}
58+
]
59+
}

experiment/aim.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
### Aim of the experiment
2+
3+
The aim of this experiment is to demonstrate and test Lamport's Mutual Exclusion algorithm in a distributed system, where users interact with processes requesting and releasing critical section access while managing communication delays.

experiment/contributors.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
EMPTY
2-
<!-- Remove all lines above this line before making changes to the file -->
31
### Subject Matter Experts
4-
| SNo. | Name | Email | Institute | ID |
2+
3+
| SNo. | Name | Email | Institute | GitHub ID |
54
| :---: | :---: | :---: | :---: | :---: |
6-
| 1 | name | email | institute | id |
5+
| 1 | Kishore Kothapalli | [email protected] | IIIT Hyderabad | KishoreKothapalliIIITH |
6+
| 2 | Subhajit Sahu | [email protected] | IIIT Hyderabad | wolfram77 |
7+
| 3 | N. Mahen | [email protected] | IIIT Hyderabad | tempmn |
8+
| 4 | Ajitanshu Singh | [email protected] | IIIT Hyderabad | ajitanshu19 |
9+
710

811
### Developers
9-
| SNo. | Name | Email | Institute | ID |
12+
13+
| SNo. | Name | Email | Institute | GitHub ID |
1014
| :---: | :---: | :---: | :---: | :---: |
11-
| 1 | name | email | institute | id |
15+
| 1 | Subhajit Sahu | [email protected] | IIIT Hyderabad | wolfram77 |
16+
| 2 | Ajitanshu Singh | [email protected] | IIIT Hyderabad | ajitanshu19 |

experiment/experiment-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
## Experiment name
1+
## Lamport’s algorithm

experiment/images/example-01.png

55.4 KB
Loading

experiment/images/example-02.png

109 KB
Loading

experiment/images/iiith-logo.png

18.8 KB
Loading

experiment/posttest.json

Lines changed: 120 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,140 @@
22
"version": 2.0,
33
"questions": [
44
{
5-
"question": "This is a Sample Question 1?",
5+
"question": "In Lamport's mutual exclusion algorithm, what is used to order requests for the Critical Section?",
66
"answers": {
7-
"a": "answer1",
8-
"b": "answer2",
9-
"c": "answer3",
10-
"d": "answer4"
7+
"a": "Physical clock timestamps",
8+
"b": "Logical clock timestamps",
9+
"c": "Process IDs only",
10+
"d": "Random priorities"
1111
},
1212
"explanations": {
13-
"a": "Explanation 1 <a href='www.google.com'>here</a>",
14-
"b": "Explanation 2",
15-
"c": "Explanation 2",
16-
"d": "Explanation 2"
13+
"a": "Incorrect. Physical clocks can vary between machines and are not reliable.",
14+
"b": "Correct. Lamport's algorithm uses logical clock timestamps.",
15+
"c": "Incorrect. Process IDs are only used to break ties.",
16+
"d": "Incorrect. There are no random priorities in Lamport's algorithm."
17+
},
18+
"correctAnswer": "b",
19+
"difficulty": "intermediate"
20+
},
21+
{
22+
"question": "What must a process wait for before entering the Critical Section in Lamport’s algorithm?",
23+
"answers": {
24+
"a": "Replies from all other processes",
25+
"b": "A token from a coordinator",
26+
"c": "Majority of acknowledgements",
27+
"d": "No waiting is required"
28+
},
29+
"explanations": {
30+
"a": "Correct. A process must receive a REPLY from every other process.",
31+
"b": "Incorrect. Lamport's algorithm does not use tokens.",
32+
"c": "Incorrect. Majority is not enough; replies are needed from all.",
33+
"d": "Incorrect. Waiting is essential to ensure mutual exclusion."
1734
},
1835
"correctAnswer": "a",
1936
"difficulty": "beginner"
2037
},
2138
{
22-
"question": "This is a Sample Question 2?",
39+
"question": "If a link becomes slow between two processes, what is the effect on mutual exclusion?",
2340
"answers": {
24-
"a": "answer1",
25-
"b": "answer2",
26-
"c": "answer3",
27-
"d": "answer4"
41+
"a": "The system may fail",
42+
"b": "Multiple processes can enter CS simultaneously",
43+
"c": "It delays message delivery but mutual exclusion is preserved",
44+
"d": "Processes will ignore slow links"
2845
},
2946
"explanations": {
30-
"a": "Explanation 1 <a href='www.google.com'>here</a>",
31-
"b": "Explanation 2",
32-
"c": "Explanation 2",
33-
"d": "Explanation 2"
47+
"a": "Incorrect. Slow links do not cause system failure.",
48+
"b": "Incorrect. Mutual exclusion is still guaranteed.",
49+
"c": "Correct. Delays may occur but correctness is maintained.",
50+
"d": "Incorrect. Processes cannot ignore message delays."
3451
},
3552
"correctAnswer": "c",
53+
"difficulty": "intermediate"
54+
},
55+
{
56+
"question": "What happens to a process’s Request Queue after it sends a RELEASE message?",
57+
"answers": {
58+
"a": "It adds new entries",
59+
"b": "It clears the served request",
60+
"c": "It increases the clock value",
61+
"d": "It sends more REQUESTs"
62+
},
63+
"explanations": {
64+
"a": "Incorrect. No new entries are added automatically.",
65+
"b": "Correct. After releasing CS, the served request is removed from the queue.",
66+
"c": "Incorrect. Clock updates happen when sending messages but that’s not the primary effect here.",
67+
"d": "Incorrect. It does not initiate more requests by itself."
68+
},
69+
"correctAnswer": "b",
70+
"difficulty": "beginner"
71+
},
72+
{
73+
"question": "In Test Mode 1, how many processes can request the Critical Section simultaneously?",
74+
"answers": {
75+
"a": "1",
76+
"b": "2",
77+
"c": "3",
78+
"d": "4"
79+
},
80+
"explanations": {
81+
"a": "Correct. Only one process can request CS at a time in Test Mode 1.",
82+
"b": "Incorrect. That happens in Test Mode 2.",
83+
"c": "Incorrect. That happens in Test Mode 3.",
84+
"d": "Incorrect. That happens in Test Mode 4."
85+
},
86+
"correctAnswer": "a",
3687
"difficulty": "beginner"
88+
},
89+
{
90+
"question": "What is the main role of the logical clock in Lamport's mutual exclusion algorithm?",
91+
"answers": {
92+
"a": "It measures real-world time",
93+
"b": "It provides unique IDs to processes",
94+
"c": "It orders events consistently across processes",
95+
"d": "It speeds up message transmission"
96+
},
97+
"explanations": {
98+
"a": "Incorrect. Logical clocks are not tied to real-world time.",
99+
"b": "Incorrect. Process IDs are separate.",
100+
"c": "Correct. Logical clocks ensure a consistent ordering of events.",
101+
"d": "Incorrect. Clock value does not affect transmission speed."
102+
},
103+
"correctAnswer": "c",
104+
"difficulty": "intermediate"
105+
},
106+
{
107+
"question": "If a process receives a REQUEST from another process with a lower timestamp, what should it do?",
108+
"answers": {
109+
"a": "Immediately grant REPLY",
110+
"b": "Queue the request and wait",
111+
"c": "Enter Critical Section itself",
112+
"d": "Ignore the REQUEST"
113+
},
114+
"explanations": {
115+
"a": "Correct. It should immediately send a REPLY if not competing.",
116+
"b": "Incorrect. It should not delay if the other process has a lower timestamp.",
117+
"c": "Incorrect. Entering CS itself would violate mutual exclusion.",
118+
"d": "Incorrect. Ignoring REQUEST violates protocol."
119+
},
120+
"correctAnswer": "a",
121+
"difficulty": "intermediate"
122+
},
123+
{
124+
"question": "Why is it important to clear the Reply Queue after a process enters the Critical Section and releases it?",
125+
"answers": {
126+
"a": "To reduce memory usage",
127+
"b": "To allow fresh REPLY collection for the next CS request",
128+
"c": "To avoid deadlock detection errors",
129+
"d": "To prevent logical clock reset"
130+
},
131+
"explanations": {
132+
"a": "Incorrect. While memory matters, correctness is the main reason.",
133+
"b": "Correct. Each new CS request must independently collect fresh replies.",
134+
"c": "Incorrect. Deadlock detection is not directly related here.",
135+
"d": "Incorrect. Logical clocks are unaffected by Reply Queue clearing."
136+
},
137+
"correctAnswer": "b",
138+
"difficulty": "intermediate"
37139
}
38140
]
39141
}

0 commit comments

Comments
 (0)