Skip to content

Commit 8af60b2

Browse files
authored
Update README.md
Add the description of Delay-o-meter
1 parent 757bff0 commit 8af60b2

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ In general, there are two goals in testing philosophers:
2121

2222
Socrates checks these two requirements for you!
2323

24-
### What is inside?
24+
### What are the tests?
2525

2626
It provides two series of tests: PERFORMANCE and DEATH TIMING.
2727

2828
A PERFORMANCE test is a stable test. By its conditions, no philosophers should die.
29-
So this script times the execution of your binary.
29+
Socrates times the execution of your binary.
3030

3131
If it exits prematurely (sooner than 40s by default) the test is failed.
3232

33-
In a DEATH TIMING test, a philosopher must die instantly. The program output
33+
In a DEATH TIMING test, a philosopher must die at a known time. The program output
3434
is then parsed to measure how soon your program reported that.
3535

3636
If your delay is more than 10ms, the test is failed!
@@ -39,6 +39,21 @@ It will print a nice average for you if you pass the test.
3939

4040
![A screenshot showing a typical test output](https://i.imgur.com/oJ43M1f.png)
4141

42+
### Delay-o-meter
43+
44+
Different machines perform sleeps with different accuracy. Socrates reports the average delay the machine will add to a 200-millisecond sleep.
45+
46+
You can also use a standalone tool and check different machines:
47+
```
48+
python3 delay_o_meter.py
49+
```
50+
51+
#### How to interpret the result?
52+
53+
The common-sense standard of a good Philosophers is less than 10ms of delay per one eat-sleep-think cycle (example: 310 150 150 should run forever).
54+
55+
**My personal opinion** is that, therefore, a machine must lose less than **3ms on average** for tests to be accurate. Let me know what you think about that!
56+
4257
### CPU load detector
4358

4459
If your CPU is loaded, your philosophers can die for no reason. The CPU will just get stuck on a task and forget to return to your starving philosophers in time.

0 commit comments

Comments
 (0)