Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new function: Host::exec_async
[simgrid.git] / include / xbt / parmap.h
1 /* A thread pool.                                          */
2
3 /* Copyright (c) 2007-2018. 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 /** @addtogroup XBT_parmap
13  * @ingroup XBT_misc
14  * @brief Parallel map.
15  *
16  * A function is applied to all elements of a std::vector in parallel with n worker threads.  The worker threads are
17  * persistent until the destruction of the parmap.
18  *
19  * If there are more than n elements in the vector, the worker threads are allowed to fetch themselves remaining work
20  * with method next() and execute it.
21  *
22  * @{
23  */
24
25 /** @brief Synchronization mode of the worker threads of a parmap. */
26 typedef enum {
27   XBT_PARMAP_POSIX,          /**< use POSIX synchronization primitives */
28   XBT_PARMAP_FUTEX,          /**< use Linux futex system call */
29   XBT_PARMAP_BUSY_WAIT,      /**< busy waits (no system calls, maximum CPU usage) */
30   XBT_PARMAP_DEFAULT         /**< futex if available, posix otherwise */
31 } e_xbt_parmap_mode_t;
32
33 /** @} */
34
35 #endif