Skip to content

Commit 6aafb4f

Browse files
committed
Change to use Picos instead of DLT and DLA
This adds support for cancelation through Picos and removes explicit support for timeouts, which simplifies the library. This basically also means that one can no longer use Kcas without a scheduler.
1 parent ab18eaa commit 6aafb4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+743
-973
lines changed

bench/bench_mvar.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ let run_one ~budgetf ?(n_adders = 2) ?(blocking_add = false) ?(n_takers = 2)
1111
let n_msgs_to_add = Atomic.make n_msgs |> Multicore_magic.copy_as_padded in
1212

1313
let init _ = () in
14+
let wrap _ () action = Scheduler.run action in
1415
let work i () =
1516
if i < n_adders then
1617
if blocking_add then
@@ -79,7 +80,7 @@ let run_one ~budgetf ?(n_adders = 2) ?(blocking_add = false) ?(n_takers = 2)
7980
(format "taker" blocking_take n_takers)
8081
in
8182

82-
Times.record ~budgetf ~n_domains ~init ~work ~after ()
83+
Times.record ~budgetf ~n_domains ~init ~wrap ~work ~after ()
8384
|> Times.to_thruput_metrics ~n:n_msgs ~singular:"message" ~config
8485

8586
let run_suite ~budgetf =

bench/bench_queue.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ let run_one ~budgetf ?(n_adders = 2) ?(blocking_add = false) ?(n_takers = 2)
2929
Atomic.set n_msgs_to_take n_msgs;
3030
Atomic.set n_msgs_to_add n_msgs
3131
in
32+
let wrap _ () action = Scheduler.run action in
3233
let work i () =
3334
if i < n_adders then
3435
let rec work () =
@@ -79,7 +80,7 @@ let run_one ~budgetf ?(n_adders = 2) ?(blocking_add = false) ?(n_takers = 2)
7980
(format "taker" blocking_take n_takers)
8081
in
8182

82-
Times.record ~budgetf ~n_domains ~init ~work ()
83+
Times.record ~budgetf ~n_domains ~init ~wrap ~work ()
8384
|> Times.to_thruput_metrics ~n:n_msgs ~singular:"message" ~config
8485

8586
let run_suite ~budgetf =

bench/bench_stack.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ let run_one ~budgetf ?(n_adders = 2) ?(blocking_add = false) ?(n_takers = 2)
2929
Atomic.set n_msgs_to_take n_msgs;
3030
Atomic.set n_msgs_to_add n_msgs
3131
in
32+
let wrap _ () action = Scheduler.run action in
3233
let work i () =
3334
if i < n_adders then
3435
let rec work () =
@@ -79,7 +80,7 @@ let run_one ~budgetf ?(n_adders = 2) ?(blocking_add = false) ?(n_takers = 2)
7980
(format "taker" blocking_take n_takers)
8081
in
8182

82-
Times.record ~budgetf ~n_domains ~init ~work ()
83+
Times.record ~budgetf ~n_domains ~init ~wrap ~work ()
8384
|> Times.to_thruput_metrics ~n:n_msgs ~singular:"message" ~config
8485

8586
let run_suite ~budgetf =

bench/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ let () =
1414
(action
1515
(run %{test} -brief))
1616
(libraries
17+
scheduler
1718
kcas_data
1819
multicore-bench
1920
backoff

doc/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
(package kcas_data))
66
(enabled_if
77
(>= %{ocaml_version} 5.0.0))
8-
(files gkmz-with-read-only-cmp-ops.md scheduler-interop.md))
8+
(files gkmz-with-read-only-cmp-ops.md))

doc/scheduler-interop.md

Lines changed: 0 additions & 178 deletions
This file was deleted.

dune

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
(mdx
2-
(package kcas_data)
3-
(deps
4-
(package kcas)
5-
(package kcas_data))
6-
(libraries domain_shims)
7-
(files README.md))
1+
;(mdx
2+
; (package kcas_data)
3+
; (deps
4+
; (package kcas)
5+
; (package kcas_data))
6+
; (libraries domain_shims)
7+
; (files README.md))

dune-project

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,22 @@
3434
(>= 4.13.0))
3535
(backoff
3636
(>= 0.1.0))
37-
(domain-local-await
38-
(>= 1.0.1))
39-
(domain-local-timeout
40-
(>= 1.0.1))
4137
(multicore-magic
4238
(>= 2.3.0))
39+
(picos
40+
(>= 0.5.0))
41+
(picos_std
42+
(and
43+
(>= 0.5.0)
44+
:with-test))
45+
(picos_stdio
46+
(and
47+
(>= 0.5.0)
48+
:with-test))
49+
(picos_mux
50+
(and
51+
(>= 0.5.0)
52+
:with-test))
4353
(domain_shims
4454
(and
4555
(>= 0.1.0)
@@ -84,9 +94,21 @@
8494
(and
8595
(>= 0.1.0)
8696
:with-test))
87-
(domain-local-await
97+
(picos
98+
(and
99+
(>= 0.5.0)
100+
:with-test))
101+
(picos_std
102+
(and
103+
(>= 0.5.0)
104+
:with-test))
105+
(picos_stdio
106+
(and
107+
(>= 0.5.0)
108+
:with-test))
109+
(picos_mux
88110
(and
89-
(>= 1.0.1)
111+
(>= 0.5.0)
90112
:with-test))
91113
(domain_shims
92114
(and

dune-workspace

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(lang dune 3.9)
2+
3+
(env
4+
(dev
5+
(ocamlopt_flags
6+
(:standard -S))
7+
(flags
8+
(:standard -warn-error -A)))
9+
(release
10+
(ocamlopt_flags
11+
(:standard -S))))
12+
13+
(display verbose)

kcas.opam

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ depends: [
1919
"dune" {>= "3.14"}
2020
"ocaml" {>= "4.13.0"}
2121
"backoff" {>= "0.1.0"}
22-
"domain-local-await" {>= "1.0.1"}
23-
"domain-local-timeout" {>= "1.0.1"}
2422
"multicore-magic" {>= "2.3.0"}
23+
"picos" {>= "0.5.0"}
24+
"picos_std" {>= "0.5.0" & with-test}
25+
"picos_stdio" {>= "0.5.0" & with-test}
26+
"picos_mux" {>= "0.5.0" & with-test}
2527
"domain_shims" {>= "0.1.0" & with-test}
2628
"alcotest" {>= "1.8.0" & with-test}
2729
"qcheck-core" {>= "0.21.2" & with-test}
@@ -46,3 +48,10 @@ build: [
4648
]
4749
dev-repo: "git+https://github.com/ocaml-multicore/kcas.git"
4850
doc: "https://ocaml-multicore.github.io/kcas/doc/kcas/Kcas/"
51+
pin-depends: [
52+
[ "picos.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
53+
[ "picos_aux.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
54+
[ "picos_mux.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
55+
[ "picos_std.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
56+
[ "picos_stdio.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
57+
]

kcas.opam.template

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
doc: "https://ocaml-multicore.github.io/kcas/doc/kcas/Kcas/"
2+
pin-depends: [
3+
[ "picos.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
4+
[ "picos_aux.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
5+
[ "picos_mux.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
6+
[ "picos_std.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
7+
[ "picos_stdio.dev" "git+https://github.com/ocaml-multicore/picos#3c758dbc01805cad19428b0dbac9d42243273979" ]
8+
]

kcas_data.opam

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ depends: [
2020
"kcas" {= version}
2121
"multicore-magic" {>= "2.3.0"}
2222
"backoff" {>= "0.1.0" & with-test}
23-
"domain-local-await" {>= "1.0.1" & with-test}
23+
"picos" {>= "0.5.0" & with-test}
24+
"picos_std" {>= "0.5.0" & with-test}
25+
"picos_stdio" {>= "0.5.0" & with-test}
26+
"picos_mux" {>= "0.5.0" & with-test}
2427
"domain_shims" {>= "0.1.0" & with-test}
2528
"multicore-bench" {>= "0.1.4" & with-test}
2629
"alcotest" {>= "1.8.0" & with-test}

src/kcas/dune

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
(library
22
(name kcas)
33
(public_name kcas)
4-
(libraries domain-local-await domain-local-timeout backoff multicore-magic))
4+
(libraries picos backoff multicore-magic))
55

6-
(mdx
7-
(package kcas)
8-
(deps
9-
(package kcas))
10-
(libraries kcas backoff domain_shims)
11-
(files kcas.mli))
6+
;(mdx
7+
; (package kcas)
8+
; (deps
9+
; (package kcas))
10+
; (libraries kcas backoff domain_shims)
11+
; (files kcas.mli))

0 commit comments

Comments
 (0)