3 /* Copyright (c) 2007-2023. The SimGrid Team.
4 * All rights reserved. */
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. */
12 /** @addtogroup XBT_parmap
14 * @brief Parallel map.
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.
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.
25 /** @brief Synchronization mode of the worker threads of a parmap. */
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;