You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+18-3
Original file line number
Diff line number
Diff line change
@@ -21,16 +21,16 @@ In general, there are two goals in testing philosophers:
21
21
22
22
Socrates checks these two requirements for you!
23
23
24
-
### What is inside?
24
+
### What are the tests?
25
25
26
26
It provides two series of tests: PERFORMANCE and DEATH TIMING.
27
27
28
28
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.
30
30
31
31
If it exits prematurely (sooner than 40s by default) the test is failed.
32
32
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
34
34
is then parsed to measure how soon your program reported that.
35
35
36
36
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.
39
39
40
40

41
41
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
+
42
57
### CPU load detector
43
58
44
59
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