package granary

  1. Overview
  2. Docs
Pure-OCaml SQL engine

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.0.3.tar.gz
sha256=8b18780ea373be48301d9f333925860a2f9110fc0ac28684295118d72b65a67e
sha512=25ca3c9c5e2b528704a542502e0f37dc33ba003f65622d969b8c2b800778585f8ef0cf89b36e6679832e3993e8303aecddfc662742baf7044d6afe4a796b8f11

doc/granary.parallel/Granary_parallel/Parallel/index.html

Module Granary_parallel.ParallelSource

Portable multi-core gate around OCaml 5 domains.

Lets call sites offer a parallel implementation that is only taken when the runtime actually has more than one domain available, falling back to a sequential equivalent on monocore targets (notably Solo5/Mirage, where a second domain cannot be spawned).

Sourceval available : unit -> bool

true when the runtime recommends more than one domain — i.e. a multi-core Unix host. Always false on monocore Solo5/Mirage, where Domain.spawn cannot create a second domain.

Sourceval run : parallel:(unit -> 'a) -> sequential:(unit -> 'a) -> 'a

run ~parallel ~sequential evaluates parallel () when available, otherwise sequential (). On Solo5 it always takes sequential, so a Domain.spawn placed inside parallel is never reached. The two thunks must be observably equivalent.