Communication Dans Un Congrès Année : 2024

Saturn: a library of verified concurrent data structures for OCaml 5

Résumé

We present Saturn, a new OCaml 5 library available on opam. Saturn offers a collection of efficient concurrent data structures: stack, queue, skiplist, hash table, workstealing deque, etc. It is well tested, benchmarked and in part formally verified.

Motivation

Sharing data between multiple threads or cores is a well-known problem. A naive approach is to take a sequential data structure and protect it with a lock. However, this approach is often inefficient in terms of performance, as locks introduce significant contention. Additionally, it may not be a sound solution as it can lead to liveness issues such as deadlock, starvation, and priority inversion.

In contrast, lock-free implementations, which rely on fine-grained synchronization instead of locks, are typically faster and guarantee system-wide progress. However, they are also more complex and come with their own set of bugs, such as the ABA problem (largely mitigated in garbage-collected languages), data races, and unexpected behaviors due to non-linearizability.

In this context, Saturn provides a collection of standard lock-free data structures, saving OCaml 5 programmers the trouble of designing their own. Currently, there is no similar project available for OCaml 5 in opam. Most OCaml 5 developers currently choose to write their own data structures, which is error-prone and time-consuming.

Fichier principal
Vignette du fichier
ocaml2024.pdf (308.47 Ko) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)
Licence

Dates et versions

hal-04681703 , version 1 (29-08-2024)

Licence

Identifiants

  • HAL Id : hal-04681703 , version 1

Citer

Clément Allain, Vesa Karvonen, Carine Morel. Saturn: a library of verified concurrent data structures for OCaml 5. OCaml Workshop 2024 - ICFP 2024, Armaël Guéneau; Sonja Heinze, Sep 2024, Milan, Italy. ⟨hal-04681703⟩
230 Consultations
310 Téléchargements

Partager

  • More