Kcas — STM for OCaml (original) (raw)

Kcas

Software Transactional Memory for OCaml

Create and use modular and composable concurrent abstractions with ease

Use familiar programming techniques

Kcas transactions are written as ordinary functions allowing you touse all the standard control flow constructs of OCaml. Furthermore, as a starting point,traditional sequential algorithms can easily be translated to parallelism-safe transactional algorithms. Transactions can becomposed sequentially, conjunctively,conditionally, and disjunctively.

Leverage the work of others

Kcas comes witha companion package of parallelism-safe data structures that you can directly use for application programming. Furthermore, due to the composability of transactions and the interoperability of Kcas, independently developed data structures can be reused in new contexts.

Coordinate by awaiting on arbitrary conditions

Kcastransactions and blocking operations can await, withoptional timeouts, on arbitrary conditions over the state of shared memory locations. Data structure implementations do not generally need to be a priori designed to support blocking.

Enjoy scalable performance

Kcas isbased on efficient and scalable lock-free algorithms.

Learn once, write anywhere

Kcas is scheduler agnostic and can work with both existing and future schedulers.

Additional resources

Kcas: Building a Lock-Free STM for OCaml (1/2) and (2/2)

Building a lock-free STM for OCaml, seevideo andslides.


Kcas is part of theMulticore OCaml project and is supported by Tarides.