templates: Use shell variables to pass parameters to 'build'.
[mclu.git] / parallel.mli
1 (* mclu: Mini Cloud
2  * Copyright (C) 2014-2015 Red Hat Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  *)
18
19 (** Simple forking parallel primitives. *)
20
21 val iter : ('a -> unit) -> 'a list -> unit
22 (** [iter f xs] iterates over each member [x] of the list [xs],
23     running [f x] in parallel in a forked subprocess.  If [f] throws
24     an exception then the function exits with an error. *)
25
26 val map : ('a -> 'b) -> 'a list -> bytes list
27 (** [map f xs] maps over each member [x] of the list [xs], running
28     [f x] in parallel in a forked subprocess.
29
30     The list of {b marsalled} values from [f] is returned - you have
31     to unmarshall them (to get back the ['b]) using
32     {!Marshal.from_bytes}.
33
34     If [f] throws an exception, then the function exits with an
35     error. *)