File tree Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1616 (synopsis " Compositional lock-free data structures and primitives for communication and synchronization" )
1717 ( depends
1818 ( kcas ( = :version ) )
19- ( mdx ( and ( >= 1 .10.0) :with -test) ) ) )
19+ ( mdx ( and ( >= 1 .10.0) :with -test) )
20+ ( multicore-magic ( and ( >= 1 .0.0) :with -test) ) ) )
2021(using mdx 0 .2)
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ depends: [
1111 "dune" {>= "3.3"}
1212 "kcas" {= version}
1313 "mdx" {>= "1.10.0" & with-test}
14+ "multicore-magic" {>= "1.0.0" & with-test}
1415 "odoc" {with-doc}
1516]
1617build: [
Original file line number Diff line number Diff line change 77(test
88 (name hashtbl_bench)
99 (modules hashtbl_bench)
10- (libraries kcas kcas_data unix)
10+ (libraries kcas kcas_data unix multicore-magic )
1111 (package kcas_data))
1212
1313(test
Original file line number Diff line number Diff line change @@ -7,15 +7,18 @@ module Int = struct
77end
88
99let bench ~n_domains ~n_ops ~n_keys ~percent_read =
10- let t = Hashtbl. create ~hashed_type: (module Int ) () in
10+ let t =
11+ Hashtbl. create ~hashed_type: (module Int ) ()
12+ |> Multicore_magic. copy_as_padded
13+ in
1114
1215 for i = 0 to n_keys - 1 do
1316 Hashtbl. replace t i i
1417 done ;
1518
1619 let barrier = Atomic. make n_domains in
1720
18- let n_ops_todo = Atomic. make n_ops in
21+ let n_ops_todo = Atomic. make n_ops |> Multicore_magic. copy_as_padded in
1922 let rec alloc_ops () =
2023 let n = Atomic. get n_ops_todo in
2124 if n = 0 then 0
You can’t perform that action at this time.
0 commit comments