From 37d41e2b1c3f0cd61bf133eeb68f132c78d753bc Mon Sep 17 00:00:00 2001 From: Carine Morel Date: Tue, 5 Nov 2024 10:32:42 +0100 Subject: [PATCH] Remove Saturn_lockfree package. (#159) --- bench/bench_htbl.ml | 4 +- bench/bench_queue.ml | 2 +- bench/bench_size.ml | 2 +- bench/bench_spsc_queue.ml | 4 +- bench/bench_stack.ml | 2 +- bench/bench_ws_deque.ml | 2 +- bench/dune | 4 +- bench/main.ml | 14 +++--- dune-project | 31 +++---------- saturn.opam | 15 +++---- saturn_lockfree.opam | 43 ------------------- {src_lockfree => src}/ArrayExtra.ml | 0 .../atomic.without_contended.ml | 0 src/dune | 12 +++++- {src_lockfree => src}/htbl/dune | 4 +- {src_lockfree => src}/htbl/htbl.body.ml | 0 {src_lockfree => src}/htbl/htbl.head_safe.ml | 0 .../htbl/htbl.head_unsafe.ml | 0 {src_lockfree => src}/htbl/htbl.mli | 0 {src_lockfree => src}/htbl/htbl_intf.mli | 4 +- {src_lockfree => src}/htbl/htbl_unsafe.mli | 0 {src_lockfree => src}/htbl/htbl_utils.ml | 0 .../michael_scott_queue.ml | 0 .../michael_scott_queue.mli | 0 .../michael_scott_queue_intf.ml | 0 .../michael_scott_queue_unsafe.ml | 0 .../michael_scott_queue_unsafe.mli | 0 .../michael_scott_queue_unsafe_node.ml | 0 {src_lockfree => src}/mpsc_queue.ml | 0 {src_lockfree => src}/mpsc_queue.mli | 0 src/saturn.ml | 26 +++++------ src/saturn.mli | 28 ++++++------ {src_lockfree => src}/size.ml | 0 {src_lockfree => src}/size.mli | 0 {src_lockfree => src}/skiplist.ml | 0 {src_lockfree => src}/skiplist.mli | 0 .../spsc_queue/spsc_queue.ml | 0 .../spsc_queue/spsc_queue.mli | 0 .../spsc_queue/spsc_queue_intf.ml | 0 .../spsc_queue/spsc_queue_unsafe.ml | 0 .../spsc_queue/spsc_queue_unsafe.mli | 0 {src_lockfree => src}/treiber_stack.ml | 0 {src_lockfree => src}/treiber_stack.mli | 0 {src_lockfree => src}/ws_deque.ml | 0 {src_lockfree => src}/ws_deque.mli | 0 src_lockfree/domain.ocaml4.ml | 1 - src_lockfree/dune | 32 -------------- src_lockfree/saturn_lockfree.ml | 39 ----------------- src_lockfree/saturn_lockfree.mli | 43 ------------------- test/htbl/dune | 22 +++++----- test/htbl/htbls/dune | 6 +-- test/htbl/htbls/htbls.ml | 4 +- test/michael_scott_queue/dune | 22 +++++----- test/michael_scott_queue/ms_queues/dune | 6 +-- .../ms_queues/ms_queues.ml | 4 +- .../stm_michael_scott_queue.ml | 2 +- test/mpsc_queue/dune | 14 +++--- test/mpsc_queue/qcheck_mpsc_queue.ml | 2 +- test/mpsc_queue/stm_mpsc_queue.ml | 5 +-- test/seqtest/seqtest.ml | 2 +- test/size/dune | 12 +++--- test/size/stm_size.ml | 5 +-- test/skiplist/dune | 16 +++---- test/skiplist/qcheck_skiplist.ml | 2 +- test/skiplist/stm_skiplist.ml | 2 +- test/spsc_queue/dune | 22 +++++----- test/spsc_queue/spsc_queues/dune | 8 ++-- test/spsc_queue/spsc_queues/spsc_queues.ml | 4 +- test/spsc_queue/stm_spsc_queue.ml | 5 +-- test/treiber_stack/dune | 14 +++--- test/treiber_stack/qcheck_treiber_stack.ml | 2 +- test/treiber_stack/stm_treiber_stack.ml | 4 +- test/ws_deque/dune | 22 +++++----- test/ws_deque/qcheck_ws_deque.ml | 2 +- test/ws_deque/stm_ws_deque.ml | 5 +-- test/ws_deque/test_ws_deque.ml | 2 +- 76 files changed, 169 insertions(+), 359 deletions(-) delete mode 100644 saturn_lockfree.opam rename {src_lockfree => src}/ArrayExtra.ml (100%) rename {src_lockfree => src}/atomic.without_contended.ml (100%) rename {src_lockfree => src}/htbl/dune (89%) rename {src_lockfree => src}/htbl/htbl.body.ml (100%) rename {src_lockfree => src}/htbl/htbl.head_safe.ml (100%) rename {src_lockfree => src}/htbl/htbl.head_unsafe.ml (100%) rename {src_lockfree => src}/htbl/htbl.mli (100%) rename {src_lockfree => src}/htbl/htbl_intf.mli (98%) rename {src_lockfree => src}/htbl/htbl_unsafe.mli (100%) rename {src_lockfree => src}/htbl/htbl_utils.ml (100%) rename {src_lockfree => src}/michael_scott_queue/michael_scott_queue.ml (100%) rename {src_lockfree => src}/michael_scott_queue/michael_scott_queue.mli (100%) rename {src_lockfree => src}/michael_scott_queue/michael_scott_queue_intf.ml (100%) rename {src_lockfree => src}/michael_scott_queue/michael_scott_queue_unsafe.ml (100%) rename {src_lockfree => src}/michael_scott_queue/michael_scott_queue_unsafe.mli (100%) rename {src_lockfree => src}/michael_scott_queue/michael_scott_queue_unsafe_node.ml (100%) rename {src_lockfree => src}/mpsc_queue.ml (100%) rename {src_lockfree => src}/mpsc_queue.mli (100%) rename {src_lockfree => src}/size.ml (100%) rename {src_lockfree => src}/size.mli (100%) rename {src_lockfree => src}/skiplist.ml (100%) rename {src_lockfree => src}/skiplist.mli (100%) rename {src_lockfree => src}/spsc_queue/spsc_queue.ml (100%) rename {src_lockfree => src}/spsc_queue/spsc_queue.mli (100%) rename {src_lockfree => src}/spsc_queue/spsc_queue_intf.ml (100%) rename {src_lockfree => src}/spsc_queue/spsc_queue_unsafe.ml (100%) rename {src_lockfree => src}/spsc_queue/spsc_queue_unsafe.mli (100%) rename {src_lockfree => src}/treiber_stack.ml (100%) rename {src_lockfree => src}/treiber_stack.mli (100%) rename {src_lockfree => src}/ws_deque.ml (100%) rename {src_lockfree => src}/ws_deque.mli (100%) delete mode 100644 src_lockfree/domain.ocaml4.ml delete mode 100644 src_lockfree/dune delete mode 100644 src_lockfree/saturn_lockfree.ml delete mode 100644 src_lockfree/saturn_lockfree.mli diff --git a/bench/bench_htbl.ml b/bench/bench_htbl.ml index 5fe3e244..970e7a0b 100644 --- a/bench/bench_htbl.ml +++ b/bench/bench_htbl.ml @@ -74,6 +74,6 @@ let run_suite ~budgetf = in List.fold_right2 (fun safe unsafe acc -> safe :: unsafe :: acc) - (run ~unsafe:false (module Saturn_lockfree.Htbl)) - (run ~unsafe:true (module Saturn_lockfree.Htbl_unsafe)) + (run ~unsafe:false (module Saturn.Htbl)) + (run ~unsafe:true (module Saturn.Htbl_unsafe)) [] diff --git a/bench/bench_queue.ml b/bench/bench_queue.ml index cbb83d86..3b5dfc9d 100644 --- a/bench/bench_queue.ml +++ b/bench/bench_queue.ml @@ -1,5 +1,5 @@ open Multicore_bench -module Queue = Saturn_lockfree.Queue +module Queue = Saturn.Queue let run_one_domain ~budgetf ?(n_msgs = 50 * Util.iter_factor) () = let t = Queue.create () in diff --git a/bench/bench_size.ml b/bench/bench_size.ml index 9e2eaed9..0ec619c9 100644 --- a/bench/bench_size.ml +++ b/bench/bench_size.ml @@ -1,5 +1,5 @@ open Multicore_bench -module Size = Saturn_lockfree.Size +module Size = Saturn.Size let run_one ~budgetf ~n_domains ?(n_ops = 250 * n_domains * Util.iter_factor) () = diff --git a/bench/bench_spsc_queue.ml b/bench/bench_spsc_queue.ml index f3706275..7b6fc4bd 100644 --- a/bench/bench_spsc_queue.ml +++ b/bench/bench_spsc_queue.ml @@ -5,7 +5,7 @@ let run_one ~unsafe ~budgetf ?(size_exponent = 3) let init _ = () in let work, before = if unsafe then - let module Queue = Saturn_lockfree.Single_prod_single_cons_queue_unsafe in + let module Queue = Saturn.Single_prod_single_cons_queue_unsafe in let t = Queue.create ~size_exponent in let before () = @@ -41,7 +41,7 @@ let run_one ~unsafe ~budgetf ?(size_exponent = 3) in (work, before) else - let module Queue = Saturn_lockfree.Single_prod_single_cons_queue in + let module Queue = Saturn.Single_prod_single_cons_queue in let t = Queue.create ~size_exponent in let before () = diff --git a/bench/bench_stack.ml b/bench/bench_stack.ml index 499c3842..1c3a5546 100644 --- a/bench/bench_stack.ml +++ b/bench/bench_stack.ml @@ -1,5 +1,5 @@ open Multicore_bench -module Stack = Saturn_lockfree.Stack +module Stack = Saturn.Stack let run_one_domain ~budgetf ?(n_msgs = 50 * Util.iter_factor) () = let t = Stack.create () in diff --git a/bench/bench_ws_deque.ml b/bench/bench_ws_deque.ml index 585225cf..f822ef9c 100644 --- a/bench/bench_ws_deque.ml +++ b/bench/bench_ws_deque.ml @@ -1,5 +1,5 @@ open Multicore_bench -module Ws_deque = Saturn_lockfree.Work_stealing_deque +module Ws_deque = Saturn.Work_stealing_deque let run_as_scheduler ~budgetf ?(n_domains = 1) () = let spawns = diff --git a/bench/dune b/bench/dune index 66c707c8..0e22cbd8 100644 --- a/bench/dune +++ b/bench/dune @@ -9,8 +9,8 @@ let () = (rule (action - (copy ../src_lockfree/htbl/htbl_intf.mli htbl_intf.ml)) - (package saturn_lockfree)) + (copy ../src/htbl/htbl_intf.mli htbl_intf.ml)) + (package saturn)) (test (package saturn) diff --git a/bench/main.ml b/bench/main.ml index 6724fa12..24870c77 100644 --- a/bench/main.ml +++ b/bench/main.ml @@ -1,12 +1,12 @@ let benchmarks = [ - ("Saturn_lockfree Queue", Bench_queue.run_suite); - ("Saturn_lockfree Single_prod_single_cons_queue", Bench_spsc_queue.run_suite); - ("Saturn_lockfree Size", Bench_size.run_suite); - ("Saturn_lockfree Skiplist", Bench_skiplist.run_suite); - ("Saturn_lockfree Htbl", Bench_htbl.run_suite); - ("Saturn_lockfree Stack", Bench_stack.run_suite); - ("Saturn_lockfree Work_stealing_deque", Bench_ws_deque.run_suite); + ("Saturn Queue", Bench_queue.run_suite); + ("Saturn Single_prod_single_cons_queue", Bench_spsc_queue.run_suite); + ("Saturn Size", Bench_size.run_suite); + ("Saturn Skiplist", Bench_skiplist.run_suite); + ("Saturn Htbl", Bench_htbl.run_suite); + ("Saturn Stack", Bench_stack.run_suite); + ("Saturn Work_stealing_deque", Bench_ws_deque.run_suite); ] let () = Multicore_bench.Cmd.run ~benchmarks () diff --git a/dune-project b/dune-project index 918bc36e..2eceb755 100644 --- a/dune-project +++ b/dune-project @@ -12,42 +12,21 @@ (package (name saturn) - (synopsis "Collection of parallelism-safe data structures for Multicore OCaml") + (synopsis "Collection of concurent-safe data structures for Multicore OCaml") (depends (ocaml (>= 4.14)) + (backoff (>= 0.1.0)) + (multicore-magic (>= 2.3.0)) + (alcotest (and (>= 1.7.0) :with-test)) (domain_shims (and (>= 0.1.0) :with-test)) - (saturn_lockfree (= :version)) + (dscheck (and (>= 0.5.0) :with-test)) (mdx (and (>= 0.4) :with-test)) - (multicore-magic (and (>= 2.3.0) :with-test)) (multicore-bench (and (>= 0.1.7) :with-test)) (multicore-magic-dscheck (and (>= 2.3.0) :with-test)) - (backoff (and (>= 0.1.0) :with-test)) - (alcotest (and (>= 1.7.0) :with-test)) (qcheck (and (>= 0.21.3) :with-test)) - (qcheck-stm (and (>= 0.3) :with-test)) (qcheck-alcotest (and (>= 0.21.3) :with-test)) - (yojson (and (>= 2.0.2) :with-test)) - (dscheck (and (>= 0.5.0) :with-test)) - (sherlodoc (and (>= 0.2) :with-doc)) - (odoc (and (>= 2.4.1) :with-doc)))) - -(package - (name saturn_lockfree) - (synopsis "Collection of lock-free data structures for Multicore OCaml") - (depends - (ocaml (>= 4.14)) - (domain_shims (and (>= 0.1.0) :with-test)) - (backoff (>= 0.1.0)) - (multicore-magic (>= 2.3.0)) - (multicore-magic-dscheck (and (>= 2.3.0) :with-test)) - (mdx (and (>= 0.4) :with-test)) - (alcotest (and (>= 1.7.0) :with-test)) - (qcheck (and (>= 0.21.3) :with-test)) (qcheck-core (and (>= 0.21.3) :with-test)) (qcheck-stm (and (>= 0.3) :with-test)) - (qcheck-multicoretests-util (and (>= 0.3) :with-test)) - (qcheck-alcotest (and (>= 0.21.3) :with-test)) (yojson (and (>= 2.0.2) :with-test)) - (dscheck (and (>= 0.5.0) :with-test)) (sherlodoc (and (>= 0.2) :with-doc)) (odoc (and (>= 2.4.1) :with-doc)))) diff --git a/saturn.opam b/saturn.opam index 83d07f6c..0fa88fcb 100644 --- a/saturn.opam +++ b/saturn.opam @@ -1,7 +1,6 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -synopsis: - "Collection of parallelism-safe data structures for Multicore OCaml" +synopsis: "Collection of concurent-safe data structures for Multicore OCaml" maintainer: ["Carine Morel" "KC Sivaramakrishnan" "Sudha Parimala"] authors: ["KC Sivaramakrishnan"] license: "ISC" @@ -11,19 +10,19 @@ bug-reports: "https://github.com/ocaml-multicore/saturn/issues" depends: [ "dune" {>= "3.14"} "ocaml" {>= "4.14"} + "backoff" {>= "0.1.0"} + "multicore-magic" {>= "2.3.0"} + "alcotest" {>= "1.7.0" & with-test} "domain_shims" {>= "0.1.0" & with-test} - "saturn_lockfree" {= version} + "dscheck" {>= "0.5.0" & with-test} "mdx" {>= "0.4" & with-test} - "multicore-magic" {>= "2.3.0" & with-test} "multicore-bench" {>= "0.1.7" & with-test} "multicore-magic-dscheck" {>= "2.3.0" & with-test} - "backoff" {>= "0.1.0" & with-test} - "alcotest" {>= "1.7.0" & with-test} "qcheck" {>= "0.21.3" & with-test} - "qcheck-stm" {>= "0.3" & with-test} "qcheck-alcotest" {>= "0.21.3" & with-test} + "qcheck-core" {>= "0.21.3" & with-test} + "qcheck-stm" {>= "0.3" & with-test} "yojson" {>= "2.0.2" & with-test} - "dscheck" {>= "0.5.0" & with-test} "sherlodoc" {>= "0.2" & with-doc} "odoc" {>= "2.4.1" & with-doc} ] diff --git a/saturn_lockfree.opam b/saturn_lockfree.opam deleted file mode 100644 index d15c84d5..00000000 --- a/saturn_lockfree.opam +++ /dev/null @@ -1,43 +0,0 @@ -# This file is generated by dune, edit dune-project instead -opam-version: "2.0" -synopsis: "Collection of lock-free data structures for Multicore OCaml" -maintainer: ["Carine Morel" "KC Sivaramakrishnan" "Sudha Parimala"] -authors: ["KC Sivaramakrishnan"] -license: "ISC" -homepage: "https://github.com/ocaml-multicore/saturn" -doc: "https://ocaml-multicore.github.io/saturn/" -bug-reports: "https://github.com/ocaml-multicore/saturn/issues" -depends: [ - "dune" {>= "3.14"} - "ocaml" {>= "4.14"} - "domain_shims" {>= "0.1.0" & with-test} - "backoff" {>= "0.1.0"} - "multicore-magic" {>= "2.3.0"} - "multicore-magic-dscheck" {>= "2.3.0" & with-test} - "mdx" {>= "0.4" & with-test} - "alcotest" {>= "1.7.0" & with-test} - "qcheck" {>= "0.21.3" & with-test} - "qcheck-core" {>= "0.21.3" & with-test} - "qcheck-stm" {>= "0.3" & with-test} - "qcheck-multicoretests-util" {>= "0.3" & with-test} - "qcheck-alcotest" {>= "0.21.3" & with-test} - "yojson" {>= "2.0.2" & with-test} - "dscheck" {>= "0.5.0" & with-test} - "sherlodoc" {>= "0.2" & with-doc} - "odoc" {>= "2.4.1" & with-doc} -] -build: [ - ["dune" "subst"] {dev} - [ - "dune" - "build" - "-p" - name - "-j" - jobs - "@install" - "@runtest" {with-test} - "@doc" {with-doc} - ] -] -dev-repo: "git+https://github.com/ocaml-multicore/saturn.git" diff --git a/src_lockfree/ArrayExtra.ml b/src/ArrayExtra.ml similarity index 100% rename from src_lockfree/ArrayExtra.ml rename to src/ArrayExtra.ml diff --git a/src_lockfree/atomic.without_contended.ml b/src/atomic.without_contended.ml similarity index 100% rename from src_lockfree/atomic.without_contended.ml rename to src/atomic.without_contended.ml diff --git a/src/dune b/src/dune index ae2a6ae8..3ffdf3bf 100644 --- a/src/dune +++ b/src/dune @@ -7,11 +7,13 @@ let () = Jbuild_plugin.V1.send @@ {| + (include_subdirs unqualified) + (library (name saturn) (public_name saturn) - (libraries - (re_export saturn_lockfree) |} + (modules_without_implementation htbl_intf) + (libraries backoff multicore-magic |} ^ maybe_threads ^ {| )) @@ -20,4 +22,10 @@ let () = (< %{ocaml_version} 5.0.0)) (action (copy domain.ocaml4.ml domain.ml))) + +(rule + (enabled_if + (< %{ocaml_version} 5.2.0)) + (action + (copy atomic.without_contended.ml atomic.ml))) |} diff --git a/src_lockfree/htbl/dune b/src/htbl/dune similarity index 89% rename from src_lockfree/htbl/dune rename to src/htbl/dune index 128fbf69..dd48045c 100644 --- a/src_lockfree/htbl/dune +++ b/src/htbl/dune @@ -19,10 +19,10 @@ (cat htbl.body.ml))))) (mdx - (package saturn_lockfree) + (package saturn) (enabled_if (and (<> %{os_type} Win32) (>= %{ocaml_version} 5.1.0))) - (libraries saturn_lockfree) + (libraries saturn) (files htbl_intf.mli)) diff --git a/src_lockfree/htbl/htbl.body.ml b/src/htbl/htbl.body.ml similarity index 100% rename from src_lockfree/htbl/htbl.body.ml rename to src/htbl/htbl.body.ml diff --git a/src_lockfree/htbl/htbl.head_safe.ml b/src/htbl/htbl.head_safe.ml similarity index 100% rename from src_lockfree/htbl/htbl.head_safe.ml rename to src/htbl/htbl.head_safe.ml diff --git a/src_lockfree/htbl/htbl.head_unsafe.ml b/src/htbl/htbl.head_unsafe.ml similarity index 100% rename from src_lockfree/htbl/htbl.head_unsafe.ml rename to src/htbl/htbl.head_unsafe.ml diff --git a/src_lockfree/htbl/htbl.mli b/src/htbl/htbl.mli similarity index 100% rename from src_lockfree/htbl/htbl.mli rename to src/htbl/htbl.mli diff --git a/src_lockfree/htbl/htbl_intf.mli b/src/htbl/htbl_intf.mli similarity index 98% rename from src_lockfree/htbl/htbl_intf.mli rename to src/htbl/htbl_intf.mli index b40ae8bc..d14945ac 100644 --- a/src_lockfree/htbl/htbl_intf.mli +++ b/src/htbl/htbl_intf.mli @@ -146,8 +146,8 @@ module type HTBL = sig An example top-level session: {[ - # module Htbl = Saturn_lockfree.Htbl - module Htbl = Saturn_lockfree.Htbl + # module Htbl = Saturn.Htbl + module Htbl = Saturn.Htbl # let t : (int, string) Htbl.t = Htbl.create diff --git a/src_lockfree/htbl/htbl_unsafe.mli b/src/htbl/htbl_unsafe.mli similarity index 100% rename from src_lockfree/htbl/htbl_unsafe.mli rename to src/htbl/htbl_unsafe.mli diff --git a/src_lockfree/htbl/htbl_utils.ml b/src/htbl/htbl_utils.ml similarity index 100% rename from src_lockfree/htbl/htbl_utils.ml rename to src/htbl/htbl_utils.ml diff --git a/src_lockfree/michael_scott_queue/michael_scott_queue.ml b/src/michael_scott_queue/michael_scott_queue.ml similarity index 100% rename from src_lockfree/michael_scott_queue/michael_scott_queue.ml rename to src/michael_scott_queue/michael_scott_queue.ml diff --git a/src_lockfree/michael_scott_queue/michael_scott_queue.mli b/src/michael_scott_queue/michael_scott_queue.mli similarity index 100% rename from src_lockfree/michael_scott_queue/michael_scott_queue.mli rename to src/michael_scott_queue/michael_scott_queue.mli diff --git a/src_lockfree/michael_scott_queue/michael_scott_queue_intf.ml b/src/michael_scott_queue/michael_scott_queue_intf.ml similarity index 100% rename from src_lockfree/michael_scott_queue/michael_scott_queue_intf.ml rename to src/michael_scott_queue/michael_scott_queue_intf.ml diff --git a/src_lockfree/michael_scott_queue/michael_scott_queue_unsafe.ml b/src/michael_scott_queue/michael_scott_queue_unsafe.ml similarity index 100% rename from src_lockfree/michael_scott_queue/michael_scott_queue_unsafe.ml rename to src/michael_scott_queue/michael_scott_queue_unsafe.ml diff --git a/src_lockfree/michael_scott_queue/michael_scott_queue_unsafe.mli b/src/michael_scott_queue/michael_scott_queue_unsafe.mli similarity index 100% rename from src_lockfree/michael_scott_queue/michael_scott_queue_unsafe.mli rename to src/michael_scott_queue/michael_scott_queue_unsafe.mli diff --git a/src_lockfree/michael_scott_queue/michael_scott_queue_unsafe_node.ml b/src/michael_scott_queue/michael_scott_queue_unsafe_node.ml similarity index 100% rename from src_lockfree/michael_scott_queue/michael_scott_queue_unsafe_node.ml rename to src/michael_scott_queue/michael_scott_queue_unsafe_node.ml diff --git a/src_lockfree/mpsc_queue.ml b/src/mpsc_queue.ml similarity index 100% rename from src_lockfree/mpsc_queue.ml rename to src/mpsc_queue.ml diff --git a/src_lockfree/mpsc_queue.mli b/src/mpsc_queue.mli similarity index 100% rename from src_lockfree/mpsc_queue.mli rename to src/mpsc_queue.mli diff --git a/src/saturn.ml b/src/saturn.ml index 8df10afd..eff05f9d 100644 --- a/src/saturn.ml +++ b/src/saturn.ml @@ -26,18 +26,14 @@ Copyright (c) 2017, Nicolas ASSOUAD ######## *) -module Queue = Saturn_lockfree.Queue -module Queue_unsafe = Saturn_lockfree.Queue_unsafe -module Stack = Saturn_lockfree.Stack -module Work_stealing_deque = Saturn_lockfree.Work_stealing_deque - -module Single_prod_single_cons_queue = - Saturn_lockfree.Single_prod_single_cons_queue - -module Single_prod_single_cons_queue_unsafe = - Saturn_lockfree.Single_prod_single_cons_queue_unsafe - -module Single_consumer_queue = Saturn_lockfree.Single_consumer_queue -module Skiplist = Saturn_lockfree.Skiplist -module Htbl = Saturn_lockfree.Htbl -module Htbl_unsafe = Saturn_lockfree.Htbl_unsafe +module Queue = Michael_scott_queue +module Queue_unsafe = Michael_scott_queue_unsafe +module Stack = Treiber_stack +module Work_stealing_deque = Ws_deque +module Single_prod_single_cons_queue = Spsc_queue +module Single_prod_single_cons_queue_unsafe = Spsc_queue_unsafe +module Single_consumer_queue = Mpsc_queue +module Size = Size +module Skiplist = Skiplist +module Htbl = Htbl +module Htbl_unsafe = Htbl_unsafe diff --git a/src/saturn.mli b/src/saturn.mli index c684525a..eac1789b 100644 --- a/src/saturn.mli +++ b/src/saturn.mli @@ -26,22 +26,18 @@ Copyright (c) 2017, Nicolas ASSOUAD ######## *) -(** Domain-safe data structures for Multicore OCaml *) +(** Lock-free data structures for Multicore OCaml *) (** {1 Data structures} *) -module Queue = Saturn_lockfree.Queue -module Queue_unsafe = Saturn_lockfree.Queue_unsafe -module Stack = Saturn_lockfree.Stack -module Work_stealing_deque = Saturn_lockfree.Work_stealing_deque - -module Single_prod_single_cons_queue = - Saturn_lockfree.Single_prod_single_cons_queue - -module Single_prod_single_cons_queue_unsafe = - Saturn_lockfree.Single_prod_single_cons_queue_unsafe - -module Single_consumer_queue = Saturn_lockfree.Single_consumer_queue -module Skiplist = Saturn_lockfree.Skiplist -module Htbl = Saturn_lockfree.Htbl -module Htbl_unsafe = Saturn_lockfree.Htbl_unsafe +module Queue = Michael_scott_queue +module Queue_unsafe = Michael_scott_queue_unsafe +module Stack = Treiber_stack +module Work_stealing_deque = Ws_deque +module Single_prod_single_cons_queue = Spsc_queue +module Single_prod_single_cons_queue_unsafe = Spsc_queue_unsafe +module Single_consumer_queue = Mpsc_queue +module Skiplist = Skiplist +module Size = Size +module Htbl = Htbl +module Htbl_unsafe = Htbl_unsafe diff --git a/src_lockfree/size.ml b/src/size.ml similarity index 100% rename from src_lockfree/size.ml rename to src/size.ml diff --git a/src_lockfree/size.mli b/src/size.mli similarity index 100% rename from src_lockfree/size.mli rename to src/size.mli diff --git a/src_lockfree/skiplist.ml b/src/skiplist.ml similarity index 100% rename from src_lockfree/skiplist.ml rename to src/skiplist.ml diff --git a/src_lockfree/skiplist.mli b/src/skiplist.mli similarity index 100% rename from src_lockfree/skiplist.mli rename to src/skiplist.mli diff --git a/src_lockfree/spsc_queue/spsc_queue.ml b/src/spsc_queue/spsc_queue.ml similarity index 100% rename from src_lockfree/spsc_queue/spsc_queue.ml rename to src/spsc_queue/spsc_queue.ml diff --git a/src_lockfree/spsc_queue/spsc_queue.mli b/src/spsc_queue/spsc_queue.mli similarity index 100% rename from src_lockfree/spsc_queue/spsc_queue.mli rename to src/spsc_queue/spsc_queue.mli diff --git a/src_lockfree/spsc_queue/spsc_queue_intf.ml b/src/spsc_queue/spsc_queue_intf.ml similarity index 100% rename from src_lockfree/spsc_queue/spsc_queue_intf.ml rename to src/spsc_queue/spsc_queue_intf.ml diff --git a/src_lockfree/spsc_queue/spsc_queue_unsafe.ml b/src/spsc_queue/spsc_queue_unsafe.ml similarity index 100% rename from src_lockfree/spsc_queue/spsc_queue_unsafe.ml rename to src/spsc_queue/spsc_queue_unsafe.ml diff --git a/src_lockfree/spsc_queue/spsc_queue_unsafe.mli b/src/spsc_queue/spsc_queue_unsafe.mli similarity index 100% rename from src_lockfree/spsc_queue/spsc_queue_unsafe.mli rename to src/spsc_queue/spsc_queue_unsafe.mli diff --git a/src_lockfree/treiber_stack.ml b/src/treiber_stack.ml similarity index 100% rename from src_lockfree/treiber_stack.ml rename to src/treiber_stack.ml diff --git a/src_lockfree/treiber_stack.mli b/src/treiber_stack.mli similarity index 100% rename from src_lockfree/treiber_stack.mli rename to src/treiber_stack.mli diff --git a/src_lockfree/ws_deque.ml b/src/ws_deque.ml similarity index 100% rename from src_lockfree/ws_deque.ml rename to src/ws_deque.ml diff --git a/src_lockfree/ws_deque.mli b/src/ws_deque.mli similarity index 100% rename from src_lockfree/ws_deque.mli rename to src/ws_deque.mli diff --git a/src_lockfree/domain.ocaml4.ml b/src_lockfree/domain.ocaml4.ml deleted file mode 100644 index 2451948d..00000000 --- a/src_lockfree/domain.ocaml4.ml +++ /dev/null @@ -1 +0,0 @@ -let cpu_relax = Thread.yield diff --git a/src_lockfree/dune b/src_lockfree/dune deleted file mode 100644 index 13efeb68..00000000 --- a/src_lockfree/dune +++ /dev/null @@ -1,32 +0,0 @@ -(* -*- tuareg -*- *) - -let maybe_threads = - if Jbuild_plugin.V1.ocaml_version < "5" then "threads.posix" else "" - -let () = - Jbuild_plugin.V1.send - @@ {| - - (include_subdirs unqualified) - - -(library - (name saturn_lockfree) - (public_name saturn_lockfree) - (modules_without_implementation htbl_intf) - (libraries backoff multicore-magic |} - ^ maybe_threads - ^ {| )) - -(rule - (enabled_if - (< %{ocaml_version} 5.0.0)) - (action - (copy domain.ocaml4.ml domain.ml))) - -(rule - (enabled_if - (< %{ocaml_version} 5.2.0)) - (action - (copy atomic.without_contended.ml atomic.ml))) -|} diff --git a/src_lockfree/saturn_lockfree.ml b/src_lockfree/saturn_lockfree.ml deleted file mode 100644 index eff05f9d..00000000 --- a/src_lockfree/saturn_lockfree.ml +++ /dev/null @@ -1,39 +0,0 @@ -(*--------------------------------------------------------------------------- - Copyright (c) 2016 KC Sivaramakrishnan. All rights reserved. - Distributed under the ISC license, see terms at the end of the file. - %%NAME%% %%VERSION%% - ---------------------------------------------------------------------------*) - -(*--------------------------------------------------------------------------- - Copyright (c) 2016 KC Sivaramakrishnan - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ---------------------------------------------------------------------------*) - -(* -######## -Copyright (c) 2017, Nicolas ASSOUAD -######## -*) - -module Queue = Michael_scott_queue -module Queue_unsafe = Michael_scott_queue_unsafe -module Stack = Treiber_stack -module Work_stealing_deque = Ws_deque -module Single_prod_single_cons_queue = Spsc_queue -module Single_prod_single_cons_queue_unsafe = Spsc_queue_unsafe -module Single_consumer_queue = Mpsc_queue -module Size = Size -module Skiplist = Skiplist -module Htbl = Htbl -module Htbl_unsafe = Htbl_unsafe diff --git a/src_lockfree/saturn_lockfree.mli b/src_lockfree/saturn_lockfree.mli deleted file mode 100644 index eac1789b..00000000 --- a/src_lockfree/saturn_lockfree.mli +++ /dev/null @@ -1,43 +0,0 @@ -(*--------------------------------------------------------------------------- - Copyright (c) 2016 KC Sivaramakrishnan. All rights reserved. - Distributed under the ISC license, see terms at the end of the file. - %%NAME%% %%VERSION%% - ---------------------------------------------------------------------------*) - -(*--------------------------------------------------------------------------- - Copyright (c) 2016 KC Sivaramakrishnan - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ---------------------------------------------------------------------------*) - -(* -######## -Copyright (c) 2017, Nicolas ASSOUAD -######## -*) - -(** Lock-free data structures for Multicore OCaml *) - -(** {1 Data structures} *) - -module Queue = Michael_scott_queue -module Queue_unsafe = Michael_scott_queue_unsafe -module Stack = Treiber_stack -module Work_stealing_deque = Ws_deque -module Single_prod_single_cons_queue = Spsc_queue -module Single_prod_single_cons_queue_unsafe = Spsc_queue_unsafe -module Single_consumer_queue = Mpsc_queue -module Skiplist = Skiplist -module Size = Size -module Htbl = Htbl -module Htbl_unsafe = Htbl_unsafe diff --git a/test/htbl/dune b/test/htbl/dune index a000a963..8a514fa9 100644 --- a/test/htbl/dune +++ b/test/htbl/dune @@ -1,25 +1,25 @@ (rule (action - (copy ../../src_lockfree/htbl/htbl.ml htbl.ml)) - (package saturn_lockfree)) + (copy ../../src/htbl/htbl.ml htbl.ml)) + (package saturn)) (rule (action - (copy ../../src_lockfree/htbl/htbl_unsafe.ml htbl_unsafe.ml)) - (package saturn_lockfree)) + (copy ../../src/htbl/htbl_unsafe.ml htbl_unsafe.ml)) + (package saturn)) (rule (action - (copy ../../src_lockfree/htbl/htbl_intf.mli htbl_intf.ml)) - (package saturn_lockfree)) + (copy ../../src/htbl/htbl_intf.mli htbl_intf.ml)) + (package saturn)) (rule (action - (copy ../../src_lockfree/size.ml size.ml)) - (package saturn_lockfree)) + (copy ../../src/size.ml size.ml)) + (package saturn)) (test - (package saturn_lockfree) + (package saturn) (name dscheck_htbl) (libraries alcotest atomic backoff dscheck multicore-magic-dscheck) (build_if @@ -34,9 +34,9 @@ (:standard -open Multicore_magic_dscheck))) (test - (package saturn_lockfree) + (package saturn) (name stm_htbl) (modules stm_htbl) - (libraries htbls saturn_lockfree qcheck-core qcheck-stm.stm stm_run) + (libraries htbls saturn qcheck-core qcheck-stm.stm stm_run) (enabled_if (= %{arch_sixtyfour} true))) diff --git a/test/htbl/htbls/dune b/test/htbl/htbls/dune index 8ecea0e4..c0cab3a0 100644 --- a/test/htbl/htbls/dune +++ b/test/htbl/htbls/dune @@ -1,8 +1,8 @@ (rule (action - (copy ../../../src_lockfree/htbl/htbl_intf.mli htbl_intf.ml)) - (package saturn_lockfree)) + (copy ../../../src/htbl/htbl_intf.mli htbl_intf.ml)) + (package saturn)) (library (name htbls) - (libraries saturn_lockfree)) + (libraries saturn)) diff --git a/test/htbl/htbls/htbls.ml b/test/htbl/htbls/htbls.ml index 1cb59e9e..4665e6d9 100644 --- a/test/htbl/htbls/htbls.ml +++ b/test/htbl/htbls/htbls.ml @@ -5,13 +5,13 @@ module type Htbl_tests = sig end module Htbl : Htbl_tests = struct - include Saturn_lockfree.Htbl + include Saturn.Htbl let name = "htbl_safe" end module Htbl_unsafe : Htbl_tests = struct - include Saturn_lockfree.Htbl_unsafe + include Saturn.Htbl_unsafe let name = "htbl_unsafe" end diff --git a/test/michael_scott_queue/dune b/test/michael_scott_queue/dune index 98c58674..aecb9e94 100644 --- a/test/michael_scott_queue/dune +++ b/test/michael_scott_queue/dune @@ -1,26 +1,26 @@ (rule (action (copy - ../../src_lockfree/michael_scott_queue/michael_scott_queue.ml + ../../src/michael_scott_queue/michael_scott_queue.ml michael_scott_queue.ml)) - (package saturn_lockfree)) + (package saturn)) (rule (action (copy - ../../src_lockfree/michael_scott_queue/michael_scott_queue_unsafe.ml + ../../src/michael_scott_queue/michael_scott_queue_unsafe.ml michael_scott_queue_unsafe.ml)) - (package saturn_lockfree)) + (package saturn)) (rule (action (copy - ../../src_lockfree/michael_scott_queue/michael_scott_queue_intf.ml + ../../src/michael_scott_queue/michael_scott_queue_intf.ml michael_scott_queue_intf.ml)) - (package saturn_lockfree)) + (package saturn)) (test - (package saturn_lockfree) + (package saturn) (name michael_scott_queue_dscheck) (libraries alcotest atomic backoff dscheck multicore-magic-dscheck) (build_if @@ -40,11 +40,11 @@ (:standard -open Multicore_magic_dscheck))) (test - (package saturn_lockfree) + (package saturn) (name qcheck_michael_scott_queue) (libraries ms_queues - saturn_lockfree + saturn barrier qcheck qcheck-core @@ -54,7 +54,7 @@ (modules qcheck_michael_scott_queue)) (test - (package saturn_lockfree) + (package saturn) (name stm_michael_scott_queue) (modules stm_michael_scott_queue) - (libraries ms_queues saturn_lockfree qcheck-core qcheck-stm.stm stm_run)) + (libraries ms_queues saturn qcheck-core qcheck-stm.stm stm_run)) diff --git a/test/michael_scott_queue/ms_queues/dune b/test/michael_scott_queue/ms_queues/dune index 278b0729..33ef2ad2 100644 --- a/test/michael_scott_queue/ms_queues/dune +++ b/test/michael_scott_queue/ms_queues/dune @@ -1,10 +1,10 @@ (rule (action (copy - ../../../src_lockfree/michael_scott_queue/michael_scott_queue_intf.ml + ../../../src/michael_scott_queue/michael_scott_queue_intf.ml michael_scott_queue_intf.ml)) - (package saturn_lockfree)) + (package saturn)) (library (name ms_queues) - (libraries saturn_lockfree)) + (libraries saturn)) diff --git a/test/michael_scott_queue/ms_queues/ms_queues.ml b/test/michael_scott_queue/ms_queues/ms_queues.ml index 41fe9549..ba7bc279 100644 --- a/test/michael_scott_queue/ms_queues/ms_queues.ml +++ b/test/michael_scott_queue/ms_queues/ms_queues.ml @@ -5,13 +5,13 @@ module type MS_queue_tests = sig end module Michael_scott_queue : MS_queue_tests = struct - include Saturn_lockfree.Queue + include Saturn.Queue let name = "michael_scott_queue_safe" end module Michael_scott_queue_unsafe : MS_queue_tests = struct - include Saturn_lockfree.Queue_unsafe + include Saturn.Queue_unsafe let name = "michael_scott_queue_unsafe" end diff --git a/test/michael_scott_queue/stm_michael_scott_queue.ml b/test/michael_scott_queue/stm_michael_scott_queue.ml index 3e1dbf63..6ff26348 100644 --- a/test/michael_scott_queue/stm_michael_scott_queue.ml +++ b/test/michael_scott_queue/stm_michael_scott_queue.ml @@ -57,7 +57,7 @@ module STM_ms_queue (Queue : Ms_queues.MS_queue_tests) = struct | _, _ -> false end - let run () = Stm_run.run ~name:("Saturn_lockfree." ^ Queue.name) (module Spec) + let run () = Stm_run.run ~name:("Saturn." ^ Queue.name) (module Spec) end let () = diff --git a/test/mpsc_queue/dune b/test/mpsc_queue/dune index 97817a5e..a97badcb 100644 --- a/test/mpsc_queue/dune +++ b/test/mpsc_queue/dune @@ -1,10 +1,10 @@ (rule (action - (copy ../../src_lockfree/mpsc_queue.ml mpsc_queue.ml)) - (package saturn_lockfree)) + (copy ../../src/mpsc_queue.ml mpsc_queue.ml)) + (package saturn)) (test - (package saturn_lockfree) + (package saturn) (name mpsc_queue_dscheck) (libraries atomic dscheck alcotest) (build_if @@ -12,10 +12,10 @@ (modules mpsc_queue mpsc_queue_dscheck)) (test - (package saturn_lockfree) + (package saturn) (name qcheck_mpsc_queue) (libraries - saturn_lockfree + saturn barrier qcheck qcheck-core @@ -25,11 +25,11 @@ (modules qcheck_mpsc_queue)) (test - (package saturn_lockfree) + (package saturn) (name stm_mpsc_queue) (modules stm_mpsc_queue) (libraries - saturn_lockfree + saturn qcheck-core qcheck-multicoretests-util qcheck-stm.stm diff --git a/test/mpsc_queue/qcheck_mpsc_queue.ml b/test/mpsc_queue/qcheck_mpsc_queue.ml index 30789b52..95a9df41 100644 --- a/test/mpsc_queue/qcheck_mpsc_queue.ml +++ b/test/mpsc_queue/qcheck_mpsc_queue.ml @@ -1,4 +1,4 @@ -module Mpsc_queue = Saturn_lockfree.Single_consumer_queue +module Mpsc_queue = Saturn.Single_consumer_queue (* Mpsc_queue is a multiple producers, single consumer queue. *) (* Producers can use the functions diff --git a/test/mpsc_queue/stm_mpsc_queue.ml b/test/mpsc_queue/stm_mpsc_queue.ml index 493e2fd4..21899ce1 100644 --- a/test/mpsc_queue/stm_mpsc_queue.ml +++ b/test/mpsc_queue/stm_mpsc_queue.ml @@ -3,7 +3,7 @@ open QCheck open STM open Util -module Mpsc_queue = Saturn_lockfree.Single_consumer_queue +module Mpsc_queue = Saturn.Single_consumer_queue module Spec = struct type cmd = Push of int | Pop | Peek | Push_head of int | Is_empty | Close @@ -114,5 +114,4 @@ let () = Dom.neg_agree_test_par ~count ~name:(name ^ " parallel, negative"); ] in - Stm_run.run ~name:"Saturn_lockfree.Mpsc_queue" ~make_domain (module Spec) - |> exit + Stm_run.run ~name:"Saturn.Mpsc_queue" ~make_domain (module Spec) |> exit diff --git a/test/seqtest/seqtest.ml b/test/seqtest/seqtest.ml index 0eda777f..12b9ed00 100644 --- a/test/seqtest/seqtest.ml +++ b/test/seqtest/seqtest.ml @@ -1,5 +1,5 @@ open Monolith -open Saturn_lockfree.Work_stealing_deque +open Saturn.Work_stealing_deque (* This sequential implementation of stacks serves as a reference. *) diff --git a/test/size/dune b/test/size/dune index 5ef579a7..67afc3bf 100644 --- a/test/size/dune +++ b/test/size/dune @@ -1,15 +1,15 @@ (library - (package saturn_lockfree) + (package saturn) (name linked_set) (modules linked_set)) (rule (action - (copy ../../src_lockfree/size.ml size.ml)) - (package saturn_lockfree)) + (copy ../../src/size.ml size.ml)) + (package saturn)) (test - (package saturn_lockfree) + (package saturn) (name dscheck_size) (modules dscheck_size size) (build_if @@ -19,7 +19,7 @@ (:standard -open Multicore_magic_dscheck))) (test - (package saturn_lockfree) + (package saturn) (name stm_size) (modules stm_size) - (libraries saturn_lockfree linked_set qcheck-core qcheck-stm.stm stm_run)) + (libraries saturn linked_set qcheck-core qcheck-stm.stm stm_run)) diff --git a/test/size/stm_size.ml b/test/size/stm_size.ml index cb8ed20e..11d7329f 100644 --- a/test/size/stm_size.ml +++ b/test/size/stm_size.ml @@ -1,4 +1,4 @@ -module Linked_set = Linked_set.Make (Atomic) (Saturn_lockfree.Size) +module Linked_set = Linked_set.Make (Atomic) (Saturn.Size) module Spec = struct type cmd = Mem of int | Add of int | Remove of int | Length @@ -59,6 +59,5 @@ module Spec = struct end let () = - Stm_run.run ~count:1000 ~verbose:true ~name:"Saturn_lockfree.Size" - (module Spec) + Stm_run.run ~count:1000 ~verbose:true ~name:"Saturn.Size" (module Spec) |> exit diff --git a/test/skiplist/dune b/test/skiplist/dune index 6f9115ba..9e1f8041 100644 --- a/test/skiplist/dune +++ b/test/skiplist/dune @@ -1,12 +1,12 @@ (rule (action (progn - (copy ../../src_lockfree/skiplist.ml skiplist.ml) - (copy ../../src_lockfree/size.ml size.ml))) - (package saturn_lockfree)) + (copy ../../src/skiplist.ml skiplist.ml) + (copy ../../src/size.ml size.ml))) + (package saturn)) (test - (package saturn_lockfree) + (package saturn) (name dscheck_skiplist) (modules skiplist size dscheck_skiplist) (build_if @@ -16,11 +16,11 @@ (:standard -open Multicore_magic_dscheck))) (test - (package saturn_lockfree) + (package saturn) (name qcheck_skiplist) (modules qcheck_skiplist) (libraries - saturn_lockfree + saturn barrier qcheck qcheck-core @@ -29,7 +29,7 @@ domain_shims)) (test - (package saturn_lockfree) + (package saturn) (name stm_skiplist) (modules stm_skiplist) - (libraries saturn_lockfree qcheck-core qcheck-stm.stm stm_run)) + (libraries saturn qcheck-core qcheck-stm.stm stm_run)) diff --git a/test/skiplist/qcheck_skiplist.ml b/test/skiplist/qcheck_skiplist.ml index 2c1f7d56..534615ce 100644 --- a/test/skiplist/qcheck_skiplist.ml +++ b/test/skiplist/qcheck_skiplist.ml @@ -1,5 +1,5 @@ module Skiplist = struct - include Saturn_lockfree.Skiplist + include Saturn.Skiplist let try_add s k = try_add s k () end diff --git a/test/skiplist/stm_skiplist.ml b/test/skiplist/stm_skiplist.ml index 1c1b8801..0ada005b 100644 --- a/test/skiplist/stm_skiplist.ml +++ b/test/skiplist/stm_skiplist.ml @@ -2,7 +2,7 @@ open QCheck open STM module Skiplist = struct - include Saturn_lockfree.Skiplist + include Saturn.Skiplist type nonrec 'a t = ('a, unit) t diff --git a/test/spsc_queue/dune b/test/spsc_queue/dune index 512ae2d1..0483183b 100644 --- a/test/spsc_queue/dune +++ b/test/spsc_queue/dune @@ -1,22 +1,20 @@ (rule (action - (copy ../../src_lockfree/spsc_queue/spsc_queue.ml spsc_queue.ml)) - (package saturn_lockfree)) + (copy ../../src/spsc_queue/spsc_queue.ml spsc_queue.ml)) + (package saturn)) (rule (action - (copy - ../../src_lockfree/spsc_queue/spsc_queue_unsafe.ml - spsc_queue_unsafe.ml)) - (package saturn_lockfree)) + (copy ../../src/spsc_queue/spsc_queue_unsafe.ml spsc_queue_unsafe.ml)) + (package saturn)) (rule (action - (copy ../../src_lockfree/spsc_queue/spsc_queue_intf.ml spsc_queue_intf.ml)) - (package saturn_lockfree)) + (copy ../../src/spsc_queue/spsc_queue_intf.ml spsc_queue_intf.ml)) + (package saturn)) (test - (package saturn_lockfree) + (package saturn) (name spsc_queue_dscheck) (libraries alcotest atomic dscheck multicore-magic-dscheck) (build_if @@ -26,13 +24,13 @@ (:standard -open Multicore_magic_dscheck))) (test - (package saturn_lockfree) + (package saturn) (name test_spsc_queue) (libraries spsc_queues domain_shims) (modules test_spsc_queue)) (test - (package saturn_lockfree) + (package saturn) (name qcheck_spsc_queue) (libraries spsc_queues @@ -45,7 +43,7 @@ (modules qcheck_spsc_queue)) (test - (package saturn_lockfree) + (package saturn) (name stm_spsc_queue) (modules stm_spsc_queue) (libraries diff --git a/test/spsc_queue/spsc_queues/dune b/test/spsc_queue/spsc_queues/dune index d8f8c715..2ff250dc 100644 --- a/test/spsc_queue/spsc_queues/dune +++ b/test/spsc_queue/spsc_queues/dune @@ -1,10 +1,8 @@ (rule (action - (copy - ../../../src_lockfree/spsc_queue/spsc_queue_intf.ml - spsc_queue_intf.ml)) - (package saturn_lockfree)) + (copy ../../../src/spsc_queue/spsc_queue_intf.ml spsc_queue_intf.ml)) + (package saturn)) (library (name spsc_queues) - (libraries saturn_lockfree)) + (libraries saturn)) diff --git a/test/spsc_queue/spsc_queues/spsc_queues.ml b/test/spsc_queue/spsc_queues/spsc_queues.ml index c29d7da8..8193519f 100644 --- a/test/spsc_queue/spsc_queues/spsc_queues.ml +++ b/test/spsc_queue/spsc_queues/spsc_queues.ml @@ -5,13 +5,13 @@ module type SPSC_tests = sig end module Spsc_queue : SPSC_tests = struct - include Saturn_lockfree.Single_prod_single_cons_queue + include Saturn.Single_prod_single_cons_queue let name = "Spsc_queue" end module Spsc_queue_unsafe : SPSC_tests = struct - include Saturn_lockfree.Single_prod_single_cons_queue_unsafe + include Saturn.Single_prod_single_cons_queue_unsafe let name = "Spsc_queue_unsafe" end diff --git a/test/spsc_queue/stm_spsc_queue.ml b/test/spsc_queue/stm_spsc_queue.ml index 99384a73..9cdc9bee 100644 --- a/test/spsc_queue/stm_spsc_queue.ml +++ b/test/spsc_queue/stm_spsc_queue.ml @@ -96,10 +96,7 @@ module STM_spsc (Spsc_queue : Spsc_queues.SPSC_tests) = struct Dom.neg_agree_test_par ~count ~name:(name ^ " parallel, negative"); ] in - Stm_run.run - ~name:("Saturn_lockfree." ^ Spsc_queue.name) - ~make_domain - (module Spec) + Stm_run.run ~name:("Saturn." ^ Spsc_queue.name) ~make_domain (module Spec) end let () = diff --git a/test/treiber_stack/dune b/test/treiber_stack/dune index 5998e9a1..b222c200 100644 --- a/test/treiber_stack/dune +++ b/test/treiber_stack/dune @@ -1,10 +1,10 @@ (rule (action - (copy ../../src_lockfree/treiber_stack.ml treiber_stack.ml)) - (package saturn_lockfree)) + (copy ../../src/treiber_stack.ml treiber_stack.ml)) + (package saturn)) (test - (package saturn_lockfree) + (package saturn) (name treiber_stack_dscheck) (libraries atomic dscheck alcotest backoff multicore-magic) (build_if @@ -17,10 +17,10 @@ (modules treiber_stack treiber_stack_dscheck)) (test - (package saturn_lockfree) + (package saturn) (name qcheck_treiber_stack) (libraries - saturn_lockfree + saturn barrier qcheck qcheck-core @@ -30,7 +30,7 @@ (modules qcheck_treiber_stack)) (test - (package saturn_lockfree) + (package saturn) (name stm_treiber_stack) (modules stm_treiber_stack) - (libraries saturn_lockfree qcheck-core qcheck-stm.stm stm_run)) + (libraries saturn qcheck-core qcheck-stm.stm stm_run)) diff --git a/test/treiber_stack/qcheck_treiber_stack.ml b/test/treiber_stack/qcheck_treiber_stack.ml index 91abe5d6..4c2d3764 100644 --- a/test/treiber_stack/qcheck_treiber_stack.ml +++ b/test/treiber_stack/qcheck_treiber_stack.ml @@ -1,4 +1,4 @@ -open Saturn_lockfree.Stack +open Saturn.Stack let tests_sequential = QCheck. diff --git a/test/treiber_stack/stm_treiber_stack.ml b/test/treiber_stack/stm_treiber_stack.ml index 9b98ea4e..7236b497 100644 --- a/test/treiber_stack/stm_treiber_stack.ml +++ b/test/treiber_stack/stm_treiber_stack.ml @@ -2,7 +2,7 @@ open QCheck open STM -module Treiber_stack = Saturn_lockfree.Stack +module Treiber_stack = Saturn.Stack module Spec = struct type cmd = Push of int | Pop | Is_empty @@ -55,4 +55,4 @@ module Spec = struct | _, _ -> false end -let () = Stm_run.run ~name:"Saturn_lockfree.Treiber_stack" (module Spec) |> exit +let () = Stm_run.run ~name:"Saturn.Treiber_stack" (module Spec) |> exit diff --git a/test/ws_deque/dune b/test/ws_deque/dune index 58e9931a..30f0858f 100644 --- a/test/ws_deque/dune +++ b/test/ws_deque/dune @@ -1,15 +1,15 @@ (rule (action - (copy ../../src_lockfree/ArrayExtra.ml ArrayExtra.ml)) - (package saturn_lockfree)) + (copy ../../src/ArrayExtra.ml ArrayExtra.ml)) + (package saturn)) (rule (action - (copy ../../src_lockfree/ws_deque.ml ws_deque.ml)) - (package saturn_lockfree)) + (copy ../../src/ws_deque.ml ws_deque.ml)) + (package saturn)) (test - (package saturn_lockfree) + (package saturn) (name ws_deque_dscheck) (libraries atomic dscheck alcotest backoff) (build_if @@ -17,17 +17,17 @@ (modules ArrayExtra ws_deque ws_deque_dscheck)) (test - (package saturn_lockfree) + (package saturn) (name test_ws_deque) - (libraries saturn_lockfree domain_shims) + (libraries saturn domain_shims) (modules test_ws_deque)) (test - (package saturn_lockfree) + (package saturn) (name qcheck_ws_deque) (libraries barrier - saturn_lockfree + saturn qcheck qcheck-core qcheck-alcotest @@ -41,11 +41,11 @@ (modules qcheck_ws_deque)) (test - (package saturn_lockfree) + (package saturn) (name stm_ws_deque) (modules stm_ws_deque) (libraries - saturn_lockfree + saturn qcheck-core qcheck-multicoretests-util qcheck-stm.stm diff --git a/test/ws_deque/qcheck_ws_deque.ml b/test/ws_deque/qcheck_ws_deque.ml index 7360a972..1a2a52d5 100644 --- a/test/ws_deque/qcheck_ws_deque.ml +++ b/test/ws_deque/qcheck_ws_deque.ml @@ -1,4 +1,4 @@ -module Ws_deque = Saturn_lockfree.Work_stealing_deque +module Ws_deque = Saturn.Work_stealing_deque (* Sequential building of a deque *) let deque_of_list l = diff --git a/test/ws_deque/stm_ws_deque.ml b/test/ws_deque/stm_ws_deque.ml index 15412f5f..5db982a4 100644 --- a/test/ws_deque/stm_ws_deque.ml +++ b/test/ws_deque/stm_ws_deque.ml @@ -3,7 +3,7 @@ open QCheck open STM open Util -module Ws_deque = Saturn_lockfree.Work_stealing_deque +module Ws_deque = Saturn.Work_stealing_deque module Spec = struct type cmd = Push of int | Pop | Steal @@ -83,5 +83,4 @@ let () = Dom.neg_agree_test_par ~count ~name:(name ^ " parallel, negative"); ] in - Stm_run.run ~name:"Saturn_lockfree.Ws_deque" ~make_domain (module Spec) - |> exit + Stm_run.run ~name:"Saturn.Ws_deque" ~make_domain (module Spec) |> exit diff --git a/test/ws_deque/test_ws_deque.ml b/test/ws_deque/test_ws_deque.ml index b4094c54..bc6a1bc5 100644 --- a/test/ws_deque/test_ws_deque.ml +++ b/test/ws_deque/test_ws_deque.ml @@ -1,4 +1,4 @@ -open Saturn_lockfree.Work_stealing_deque +open Saturn.Work_stealing_deque (** Tests *) let test_empty () =