File tree Expand file tree Collapse file tree 7 files changed +41
-339
lines changed Expand file tree Collapse file tree 7 files changed +41
-339
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pin-depends: [
30
30
["ppx_deriving_qcheck.0.2.0" "git+https://github.com/c-cube/qcheck.git#master"]
31
31
32
32
["kcas.0.14" "git+https://github.com/ocaml-multicore/kcas#master"]
33
- ["lockfree.0.13 " "git+https://github.com/ocaml-multicore/lockfree#master "]
33
+ ["lockfree.v0.2.0 " "git+https://github.com/ocaml-multicore/lockfree#main "]
34
34
]
35
35
36
36
build: [
Original file line number Diff line number Diff line change 1
- ;; test of ws_deque from domainslib
1
+ ;; tests of Domainslib
2
2
3
3
;; this prevents the tests from running on a default build
4
4
(alias
5
5
(name default)
6
6
(package multicoretests)
7
- (deps ws_deque_test.exe task_one_dep.exe task_more_deps.exe task_parallel.exe))
8
-
9
- (executable
10
- (name ws_deque_test)
11
- (modules ws_deque_test)
12
- (libraries qcheck STM domainslib)
13
- (preprocess (pps ppx_deriving.show)))
14
-
15
- (env
16
- (_
17
- (binaries
18
- (../check_error_count.exe as check_error_count))))
19
-
20
- (rule
21
- (alias runtest)
22
- (package multicoretests)
23
- (deps ws_deque_test.exe)
24
- (action
25
- (progn
26
- (bash "(./ws_deque_test.exe --no-colors --verbose || echo 'test run triggered an error') | tee wsd-output.txt")
27
- (run %{bin:check_error_count} "domainslib/ws_deque_test" 1 wsd-output.txt))))
28
-
7
+ (deps task_one_dep.exe task_more_deps.exe task_parallel.exe))
29
8
30
9
;; tests of Domainslib.Task's async functionality (non-STM)
31
10
Original file line number Diff line number Diff line change 1
1
Tests of the lockfree library
2
2
=============================
3
3
4
- Two linearizability tests fail:
4
+ This contains a test of work-stealing deque - the only module in lockfree.v0.2.0.
5
+
6
+ - A previous version found an issue with ` size ` sometimes returning ` -1 ` when invoked in parallel.
7
+ This observation was taken into account for v.0.2.0, which would eliminate ` size ` and ` is_empty ` from the interface,
8
+ leaving only ` push ` , ` pop ` , and ` steal ` .
9
+
10
+ We test the above in two ways:
11
+ - a positive test lets an owner domain invoke ` push ` and ` pop ` and a parallel stealer domain invoke only ` steal ` .
12
+ - a negative test lets both owner and stealer invoke all three operations, thus breaking the contract.
13
+
14
+
15
+
16
+
17
+ Older tests
18
+ -----------
19
+
20
+ An older version tested lockfree.0.1.3 in which two linearizability tests would fail:
5
21
6
22
- The Lockfree.Hash test in [ lin_tests.ml] ( lin_tests.ml )
7
23
Original file line number Diff line number Diff line change 1
1
;; Test of the lockfree library
2
2
3
+ ;; test of ws_deque
4
+
3
5
;; this prevents the tests from running on a default build
4
6
(alias
5
7
(name default)
6
8
(package multicoretests)
7
- (deps lf_list_test.exe lin_tests .exe))
9
+ (deps ws_deque_test .exe))
8
10
9
11
(executable
10
- (name lf_list_test )
11
- (modules lf_list_test )
12
+ (name ws_deque_test )
13
+ (modules ws_deque_test )
12
14
(libraries qcheck STM lockfree)
13
- (preprocess (pps ppx_deriving.show ppx_deriving.eq )))
15
+ (preprocess (pps ppx_deriving.show)))
14
16
15
17
(env
16
18
(_
20
22
(rule
21
23
(alias runtest)
22
24
(package multicoretests)
23
- (deps lf_list_test.exe)
24
- (action (run ./%{deps} --no-colors --verbose)))
25
-
26
-
27
- ;; Linearizability tests of the lockfree library
28
-
29
- (executable
30
- (name lin_tests)
31
- (modules lin_tests)
32
- (flags (:standard -w -27))
33
- (libraries qcheck lin lockfree)
34
- (preprocess (pps ppx_deriving_qcheck ppx_deriving.show ppx_deriving.eq)))
35
-
36
- (rule
37
- (alias runtest)
38
- (package multicoretests)
39
- (deps lin_tests.exe)
25
+ (deps ws_deque_test.exe)
40
26
(action
41
27
(progn
42
- (bash "(./lin_tests .exe --no-colors --verbose || echo 'test run triggered an error') | tee lin -output.txt")
43
- (run %{bin:check_error_count} "lockfree/lin_tests" 2 lin -output.txt))))
28
+ (bash "(./ws_deque_test .exe --no-colors --verbose || echo 'test run triggered an error') | tee wsd -output.txt")
29
+ (run %{bin:check_error_count} "lockfree/ws_deque_test" 1 wsd -output.txt))))
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments