-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
I guess kcas is still experimental and we can refine the API. I took a quick reading of the API (module signature) and I think it could use some work.
Here are my (non-exhaustive) first-impression notes on the API:
- Overall, on first impression, the API could perhaps use some reorganisation, either to subsections or to submodules, to more clearly separate operations on single refs, safe and unsafe operations on a single ref, and operations on multiple refs.
- Why is there both
Kcas.casandKcas.W1.cas?- Answer:
W1could be dropped as it essentially duplicatesAtomic.
- Answer:
- The APIs of
mapandtry_mapcould maybe use polymorphic variants:(This should not have major negative impact on performance.)val try_map : 'a ref -> ('a -> 'a option) -> [ `Failed | `Aborted | `Success of 'a ] val map : 'a ref -> ('a -> 'a option) -> [ `Aborted | `Success of 'a ]
- Backoff measured in milliseconds sounds excessive as modern CPUs can do incredible amount of work in a single millisecond.
- I would drop the separate
module type Backoff = sig ... endas one can saymodule type of Backoff.
Sudha247
Metadata
Metadata
Assignees
Labels
No labels