[ANN] Release of Saturn 1.0

I am thrilled to announce the release of Saturn 1.0!

Saturn is a collection of concurrent-safe data structures designed for OCaml 5. These structures have been:

  • thoroughly tested with amazing tools like STM (see this blog post) and DScheck,
  • benchmarked for performance,
  • optimized for efficiency,
  • and even verified in some cases!

If you’re curious about the motivation behind Saturn and the challenges it addresses, you can read more here.

What Can You Do with Saturn?

Saturn provides a variety of data structures, including queues, stacks, hash tables, and more. All of these structures are lock-free, linearizable, and specifically designed to take full advantage of OCaml 5’s multicore capabilities.

Portable Data Structures

Lock-freedom is a progress property that guarantees system-wide progress. This is a powerful and desirable feature, though it comes at the cost of some overhead. However, it offers a significant advantage: lock-free data structures avoid the need for scheduler-specific blocking mechanisms, making them compatible with any scheduler, such as Eio or Domainslib.

Restrictions

Saturn’s data structures are not composable, meaning you cannot combine them (e.g., use Saturn.Queue inside Saturn.Htbl) while preserving properties like lock-freedom and linearizability.

They are also not extensible outside of Saturn without losing these properties. For instance, Saturn.Queue does not include a length function because implementing one would introduce significant overhead (see Saturn.Bounded_queue for an example of this tradeoff). Attempting to add this functionality, such as by wrapping the queue:

type 'a t = {size: int Atomic.t; queue : 'a Saturn.Queue.t}

would result in a structure that either loses lock-freedom or is no longer linearizable.

If you need composable lock-free data structures, consider exploring kcas_data.

Call to Action

  • Try It Out: Give Saturn a try in your projects and let us know how it works for you. If you encounter any bugs or issues, please report them on our GitHub repository.
  • Share Your Use Case: Are you already using Saturn? Let us know in the comments what you’re building with it!
  • Contribute: We’d love to have more contributors. Whether it’s implementing new features, improving documentation, or suggesting enhancements, your contributions are welcome!
  • Help Shape the Future: What would you like to see in Saturn? Is there a missing data structure you need? Share your thoughts to help us build a roadmap for future development.

Thank you for your support!

Talks and Resources

If you want to learn more about Saturn, I gave a talk at the 2024 OCaml Workshop—check out the short paper and the talk.

To dive deeper into concurrent-safe data structures, I highly recommend having a look at The Art of Multiprocessor Programming, which explores the differences in design between lock-based and lock-free data structures.

Commercial Support

If you’re interested in incorporating Saturn into your commercial applications, Tarides offers professional development and support services. Feel free to contact us for more details.

28 Likes

Thanks a lot! It looks like the links to the modules in the readme go to 404.