19 #ifndef LIBMESH_THREADS_H 20 #define LIBMESH_THREADS_H 23 #include "libmesh/libmesh_config.h" 24 #include "libmesh/libmesh_common.h" 28 #if defined(LIBMESH_HAVE_TBB_API) && defined(LIBMESH_HAVE_PTHREAD) 29 MULTIPLE THREADING MODELS CANNOT BE SIMULTANEOUSLY ACTIVE
75 #ifndef LIBMESH_ENABLE_PERFORMANCE_LOGGING 99 template <
typename Callable>
122 #define LIBMESH_SQUASH_HEADER_WARNING 123 #ifdef LIBMESH_HAVE_TBB_API 124 # include "libmesh/threads_tbb.h" 125 #elif LIBMESH_HAVE_PTHREAD 126 # include "libmesh/threads_pthread.h" 128 # include "libmesh/threads_none.h" 142 template <
typename T>
168 const unsigned int new_grainsize = 1000) :
171 this->
reset(first, last);
206 middle = beginning + (ending - beginning)/2u;
284 #endif // LIBMESH_THREADS_H Simple compatibility class for std::thread 'concurrent' execution.
NonConcurrentThread(Callable f)
Constructor.
BlockedRange(const const_iterator first, const const_iterator last, const unsigned int new_grainsize=1000)
Constructor.
BlockedRange(const unsigned int new_grainsize=1000)
Constructor.
void join()
Join is a no-op, since the constructor blocked until completion.
const_iterator end() const
End of the range.
recursive_mutex recursive_mtx
A convenient recursive mutex object which can be used for obtaining locks.
Dummy "splitting object" used to distinguish splitting constructors from copy constructors.
bool is_divisible() const
const bool _logging_was_enabled
The libMesh namespace provides an interface to certain functionality in the library.
void reset(const const_iterator first, const const_iterator last)
Resets the StoredRange to contain [first,last).
bool in_threads
A boolean which is true iff we are in a Threads:: function It may be useful to assert(!Threadsin_thre...
We use a class to turn perf logging off and on within threads, to be exception-safe and to avoid forc...
Blocked range which can be subdivided and executed in parallel.
unsigned int grainsize() const
The grain size for the range.
void grainsize(const unsigned int &gs)
Set the grain size.
const_iterator begin() const
Beginning of the range.
bool joinable() const
Always joinable.
T const_iterator
Allows an StoredRange to behave like an STL container.
We use a class to turn Threads::in_threads on and off, to be exception-safe.
BlockedRange(const BlockedRange< T > &r)
Copy constructor.
BlockedRange(BlockedRange< T > &r, Threads::split)
Splits the range r.
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.