Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "Change those functions to public for use external parser."
[simgrid.git] / include / xbt / parmap.h
1 /* A thread pool.                                          */
2
3 /* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9 #ifndef _XBT_PARMAP_H
10 #define _XBT_PARMAP_H
11
12 #include "xbt/misc.h"           /* SG_BEGIN_DECL */
13 #include "xbt/function_types.h"
14 #include "xbt/dynar.h"
15
16 SG_BEGIN_DECL()
17
18 /** @addtogroup XBT_parmap
19   * @brief Parallel map.
20   *
21   * A function is applied to all the elements of a dynar in parallel
22   * using threads. The threads are persistent until the destruction
23   * of the parmap object.
24   * @{
25   */
26   /** \brief Queue data type (opaque type) */
27
28 typedef struct s_xbt_parmap *xbt_parmap_t;
29
30 XBT_PUBLIC(xbt_parmap_t) xbt_parmap_new(unsigned int num_workers);
31
32 XBT_PUBLIC(void) xbt_parmap_apply(xbt_parmap_t parmap,
33                                   void_f_pvoid_t fun,
34                                   xbt_dynar_t data);
35
36 XBT_PUBLIC(void) xbt_parmap_destroy(xbt_parmap_t parmap);
37
38 /** @} */
39
40 SG_END_DECL()
41
42 #endif