Skip to content

Commit 0931282

Browse files
authored
Merge pull request #53 from bikallem/ocaml-5.00
Make domainslib build/run with OCaml 5.00 after PR #704
2 parents 5104ae9 + 28957cd commit 0931282

File tree

7 files changed

+8
-7
lines changed

7 files changed

+8
-7
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
default: https://github.com/ocaml/opam-repository.git
4242
cache-prefix: ${{ steps.multicore_hash.outputs.commit }}
4343

44-
- run: opam install . --deps-only
44+
- run: opam install . --deps-only --with-test
4545

4646
- run: opam exec -- make all
4747

domainslib.opam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ depends: [
1212
"base-domains"
1313
"ocamlfind" {build}
1414
"dune" {build}
15+
"mirage-clock-unix" {with-test}
1516
]
1617
depopts: []
1718
build: [

lib/multi_channel.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ let rec recv_poll_repeated mchan dls repeats =
149149
| Exit ->
150150
if repeats = 1 then raise Exit
151151
else begin
152-
Domain.Sync.cpu_relax ();
152+
Domain.cpu_relax ();
153153
recv_poll_repeated mchan dls (repeats - 1)
154154
end
155155

lib/task.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ let rec await pool promise =
7575
| Task (t, p) -> do_task t p
7676
| Quit -> raise TasksActive
7777
with
78-
| Exit -> Domain.Sync.cpu_relax ()
78+
| Exit -> Domain.cpu_relax ()
7979
end;
8080
await pool promise
8181
| Some (Ok v) -> v

lib/ws_deque.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ module M : S = struct
189189
if Atomic.compare_and_set q.top t (t + 1) then
190190
release out
191191
else begin
192-
Domain.Sync.cpu_relax ();
192+
Domain.cpu_relax ();
193193
steal q
194194
end
195195

test/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
(test
6161
(name task_throughput)
62-
(libraries domainslib)
62+
(libraries domainslib mirage-clock-unix)
6363
(modules task_throughput)
6464
(modes native))
6565

test/task_throughput.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ let _ =
5454

5555
let hist = TimingHist.make 5 25 in
5656
for _ = 1 to n_iterations do
57-
let t0 = Domain.timer_ticks () in
57+
let t0 = Mclock.elapsed_ns() in
5858
T.parallel_for pool ~start:1 ~finish:n_tasks ~body:(fun _ -> ());
59-
let t = Int64.sub (Domain.timer_ticks ()) t0 in
59+
let t = Int64.sub (Mclock.elapsed_ns ()) t0 in
6060
TimingHist.add_point hist (Int64.to_int t);
6161
done;
6262

0 commit comments

Comments
 (0)