Skip to content

Commit 0b59969

Browse files
committed
Use backoff library
1 parent abd47fe commit 0b59969

File tree

10 files changed

+5
-132
lines changed

10 files changed

+5
-132
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44

55
Next version:
66

7+
- Move `Backoff` module to its own `backoff` package (@lyrm, @polytypic)
78
- Support padding to avoid false sharing (@polytypic)
89
- Pass through `?timeoutf` to blocking operations on data structures
910
(@polytypic)

dune-project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
(description "A software transactional memory (STM) implementation based on an atomic lock-free multi-word compare-and-set (MCAS) algorithm enhanced with read-only compare operations and ability to block awaiting for changes.")
1212
(depends
1313
(ocaml (>= 4.13.0))
14+
(backoff (>= 0.1.0))
1415
(domain-local-await (>= 0.2.0))
1516
(domain-local-timeout (>= 0.1.0))
1617
(multicore-magic (>= 1.0.0))

kcas.opam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ bug-reports: "https://github.com/ocaml-multicore/kcas/issues"
1515
depends: [
1616
"dune" {>= "3.3"}
1717
"ocaml" {>= "4.13.0"}
18+
"backoff" {>= "0.1.0"}
1819
"domain-local-await" {>= "0.2.0"}
1920
"domain-local-timeout" {>= "0.1.0"}
2021
"multicore-magic" {>= "1.0.0"}

src/kcas/backoff.ml

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

src/kcas/backoff.mli

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

src/kcas/domain.ocaml4.ml

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

src/kcas/dune

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
(library
22
(name kcas)
33
(public_name kcas)
4-
(libraries domain-local-await domain-local-timeout multicore-magic))
5-
6-
(rule
7-
(targets domain.ml)
8-
(deps domain.ocaml4.ml)
9-
(enabled_if
10-
(< %{ocaml_version} 5.0.0))
11-
(action
12-
(progn
13-
(copy domain.ocaml4.ml domain.ml))))
4+
(libraries domain-local-await domain-local-timeout backoff multicore-magic))
145

156
(mdx
167
(package kcas)
178
(deps
189
(package kcas))
1910
(preludes kcas.prelude.ml)
20-
(libraries kcas domain_shims)
11+
(libraries kcas backoff domain_shims)
2112
(files kcas.mli))

src/kcas/kcas.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ let fenceless_get = Atomic.get
1717
let fenceless_set = Atomic.set
1818
*)
1919

20-
module Backoff = Backoff
21-
2220
module Timeout = struct
2321
exception Timeout
2422

src/kcas/kcas.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@
101101
can skip over these. The documentation links back to these modules where
102102
appropriate. *)
103103

104-
module Backoff : module type of Backoff
105-
106104
(** Timeout support. *)
107105
module Timeout : sig
108106
exception Timeout

test/kcas/test.ml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -348,18 +348,6 @@ let test_post_commit () =
348348

349349
(* *)
350350

351-
let test_backoff () =
352-
let b = Backoff.create ~lower_wait_log:5 ~upper_wait_log:6 () in
353-
assert (Backoff.get_wait_log b = 5);
354-
let b = Backoff.once b in
355-
assert (Backoff.get_wait_log b = 6);
356-
let b = Backoff.once b in
357-
assert (Backoff.get_wait_log b = 6);
358-
let b = Backoff.reset b in
359-
assert (Backoff.get_wait_log b = 5)
360-
361-
(* *)
362-
363351
let test_blocking () =
364352
let state = Loc.make `Spawned in
365353
let await state' =
@@ -674,7 +662,6 @@ let () =
674662
[ Alcotest.test_case "" `Quick test_presort_and_is_in_log_xt ] );
675663
("updates", [ Alcotest.test_case "" `Quick test_updates ]);
676664
("post commit", [ Alcotest.test_case "" `Quick test_post_commit ]);
677-
("backoff", [ Alcotest.test_case "" `Quick test_backoff ]);
678665
("blocking", [ Alcotest.test_case "" `Quick test_blocking ]);
679666
( "no unnecessary wakeups",
680667
[ Alcotest.test_case "" `Quick test_no_unnecessary_wakeups ] );

0 commit comments

Comments
 (0)