Skip to content

Commit b9c6c3f

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 b9c6c3f

Some content is hidden

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

56 files changed

+440
-553
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: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
(mdx
2-
(package kcas_data)
3-
(deps
4-
(package kcas)
5-
(package kcas_data))
6-
(enabled_if
7-
(>= %{ocaml_version} 5.0.0))
8-
(files gkmz-with-read-only-cmp-ops.md scheduler-interop.md))
1+
;(mdx
2+
; (package kcas_data)
3+
; (deps
4+
; (package kcas)
5+
; (package kcas_data))
6+
; (enabled_if
7+
; (>= %{ocaml_version} 5.0.0))
8+
; (files gkmz-with-read-only-cmp-ops.md scheduler-interop.md))

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: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@
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))
37+
(picos
38+
(>= 0.5.0))
4139
(multicore-magic
4240
(>= 2.3.0))
4341
(domain_shims
@@ -84,9 +82,9 @@
8482
(and
8583
(>= 0.1.0)
8684
:with-test))
87-
(domain-local-await
85+
(picos
8886
(and
89-
(>= 1.0.1)
87+
(>= 0.5.0)
9088
:with-test))
9189
(domain_shims
9290
(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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ 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"}
22+
"picos" {>= "0.5.0"}
2423
"multicore-magic" {>= "2.3.0"}
2524
"domain_shims" {>= "0.1.0" & with-test}
2625
"alcotest" {>= "1.8.0" & with-test}
@@ -46,3 +45,6 @@ build: [
4645
]
4746
dev-repo: "git+https://github.com/ocaml-multicore/kcas.git"
4847
doc: "https://ocaml-multicore.github.io/kcas/doc/kcas/Kcas/"
48+
pin-depends: [
49+
[ "picos.dev" "git+https://github.com/ocaml-multicore/picos#383e3eef900621dc55ecde58a36bdd2e9ae5a2db" ]
50+
]

kcas.opam.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
doc: "https://ocaml-multicore.github.io/kcas/doc/kcas/Kcas/"
2+
pin-depends: [
3+
[ "picos.dev" "git+https://github.com/ocaml-multicore/picos#383e3eef900621dc55ecde58a36bdd2e9ae5a2db" ]
4+
]

kcas_data.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ 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}
2424
"domain_shims" {>= "0.1.0" & with-test}
2525
"multicore-bench" {>= "0.1.4" & with-test}
2626
"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)