Library
Module
Module type
Parameter
Class
Class type
Picos, or pico-scheduler framework, is a framework for building interoperable elements of effects based cooperative concurrent programming models such as
If you are the author of an application level concurrent programming library or framework, then Picos should not fundamentally be competing with your work. However, Picos and libraries built on top of Picos probably do have overlap with your work and making your work Picos compatible may offer benefits:
Of course, interoperability does have some costs. It takes time to understand Picos and it takes time to implement Picos compatibility. Implementing your programming model elements in terms of Picos primitives may not give ideal results. To address concerns such as those, a conscious effort has been made to keep Picos as minimal and unopinionated as possible.
Picos is essentially an interface between schedulers and other elements. Two phrases, Picos compatible and Implemented in Picos, are used to describe the opposing sides of this contract.
The idea is that schedulers provide their own handlers for the Picos effects. By handling the Picos effects a scheduler allows any libraries built on top of the Picos concepts to be used with the scheduler. Such a scheduler is then said to be Picos compatible.
A scheduler is just one element of a concurrent programming model. Separately from making a scheduler Picos compatible, one may choose to implement other elements of the programming model, e.g. a particular approach to structuring concurrency or a particular collection of communication and synchronization primitives, in terms of the Picos concepts. Such scheduler agnostic elements can then be used on any Picos compatible scheduler and are said to be Implemented in Picos.
The core of Picos is designed and developed with various goals and principles in mind.
The documentation of the concepts includes design rationale for some of the specific ideas behind their detailed design.
Picos aims to be unopinionated and flexible enough to allow higher level libraries to provide many different kinds of concurrent programming models. While it is impossible to give a complete list of what Picos does not dictate, it is perhaps illuminating to explicitly mention some of those:
Let's build an incredible ecosystem of interoperable concurrent programming libraries and frameworks!
The Picos package is divided into multiple libraries.
The only essential part of the package is the core framework.
Picos
Framework for interoperable effects based concurrency.Everything else is entirely opt-in and you are free to mix-and-match with any other Picos compatible schedulers and libraries implemented in Picos or develop your own.
These are minimalistic, but fully-functioning, schedulers provided as samples.
Picos_fifos
Basic single-threaded effects based Picos
compatible scheduler for OCaml 5.Picos_lwt
A functor for building a Picos
compatible direct style interface to Lwt
with given implementation of sleep.Picos_threaded
Basic Thread
based Picos
compatible scheduler for OCaml 4.You may find these useful for both understanding the core Picos framework and for testing your own libraries implemented in Picos.
These are examples of libraries implemented in Picos.
Picos_structured
Basic structured concurrency primitives for Picos
.Picos_sync
Basic communication and synchronization primitives for Picos
.Picos_stdio
Basic IO facilities based on OCaml standard libraries for Picos
.Picos_select
Basic Unix.select
based IO event loop for Picos
.The IO libraries in this package are built only on top of the standard libraries distributed with OCaml and are hopefully useful for building simple applications. Bindings to asynchronous system IO libraries are outside the scope of this package.
These have no dependency to the core Picos
framework and are used in the implementation of the other libraries.
Picos_domain
Minimalistic domain API available both on OCaml 5 and on OCaml 4.Picos_exn_bt
Wrapper for exceptions with backtraces.Picos_fd
Externally reference counted file descriptors.Picos_htbl
Lock-free hash table.Picos_mpsc_queue
Multi-producer, single-consumer queue.Picos_rc
External reference counting tables for disposable resources.Picos_thread
Minimalistic thread API available with or without threads.posix
.Some of these libraries might be moved to other packages in the future.
Many operation in the Picos libraries use non-blocking algorithms. Unless explicitly specified otherwise,