Skip to content

Commit 025c2a9

Browse files
committed
Avoiding repetition and moving rarely needed info out of the top
1 parent 0e87d57 commit 025c2a9

File tree

3 files changed

+27
-19
lines changed

3 files changed

+27
-19
lines changed

lib/index.mld

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ These are examples of libraries implemented in Picos.
169169
Picos_select
170170
}
171171

172+
{^ These libraries are both meant to serve as examples of what can be done and
173+
to also provide practical means for programming with fibers. Hopefully there
174+
will be many more libraries implemented in Picos like these providing
175+
different approaches, patterns, and idioms for structuring concurrent
176+
programs.}
177+
172178
{^ The IO libraries in this package are built only on top of the standard
173179
libraries distributed with OCaml and are hopefully useful for building simple
174180
applications. Bindings to asynchronous system IO libraries are outside the

lib/picos_structured/picos_structured.mli

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
(** Basic structured concurrency primitives for {!Picos}.
22
33
This library essentially provides one application programming interface for
4-
structuring fibers with any Picos compatible scheduler. This library is
5-
both meant to serve as an example of what can be done and to also provide
6-
practical means for programming with fibers. Hopefully there will be many
7-
more libraries implemented in Picos like this providing different
8-
approaches, patterns, and idioms for structuring concurrent programs.
4+
structuring fibers with any Picos compatible scheduler.
95
106
For the {{!examples} examples} we open some modules:
117

lib/picos_sync/picos_sync.mli

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
(** Basic communication and synchronization primitives for {!Picos}.
22
3-
The optional [padded] argument taken by several constructor functions, e.g.
4-
{!Mutex.create} and {!Condition.create}, defaults to [false]. When
5-
explicitly specified as [~padded:true] the object is allocated in a way to
6-
avoid {{:https://en.wikipedia.org/wiki/False_sharing} false sharing}. For
7-
relatively long lived objects this can improve performance and make
8-
performance more stable at the cost of using more memory. It is not
9-
recommended to use [~padded:true] for short lived objects. *)
3+
This library essentially provides a conventional set of communication and
4+
synchronization primitives for concurrent programming with any Picos
5+
compatible scheduler.
6+
7+
For the {{!examples} examples} we open some modules:
8+
9+
{[
10+
open Picos_structured
11+
open Picos_sync
12+
]} *)
1013

1114
(** {1 Modules} *)
1215

@@ -255,13 +258,6 @@ end
255258

256259
(** {1 Examples}
257260
258-
First we open some modules for convenience:
259-
260-
{[
261-
open Picos_structured
262-
open Picos_sync
263-
]}
264-
265261
{2 A simple bounded queue}
266262
267263
Here is an example of a simple bounded (blocking) queue using a mutex and
@@ -378,3 +374,13 @@ end
378374
Notice how the producer was able to push three elements to the queue after
379375
which the fourth push blocked and the consumer was started. Also, after
380376
canceling the consumer, the queue could still be used just fine. *)
377+
378+
(** {1 Conventions}
379+
380+
The optional [padded] argument taken by several constructor functions, e.g.
381+
{!Mutex.create} and {!Condition.create}, defaults to [false]. When
382+
explicitly specified as [~padded:true] the object is allocated in a way to
383+
avoid {{:https://en.wikipedia.org/wiki/False_sharing} false sharing}. For
384+
relatively long lived objects this can improve performance and make
385+
performance more stable at the cost of using more memory. It is not
386+
recommended to use [~padded:true] for short lived objects. *)

0 commit comments

Comments
 (0)