SPH
Classes | Namespaces | Functions
ThreadLocal.h File Reference

Template for thread-local storage. More...

#include "objects/containers/Array.h"
#include "objects/utility/Iterator.h"
#include "objects/wrappers/Optional.h"
#include "thread/Scheduler.h"

Go to the source code of this file.

Classes

struct  Detail::ValueInitTag
 
struct  Detail::FunctorInitTag
 
struct  Detail::ParamTraits< TArgs >
 
struct  Detail::ParamTraits< TArg >
 
class  ThreadLocal< Type >
 Template for storing a copy of a value for every thread in given scheduler. More...
 
class  ThreadLocal< Type >::LocalIterator< T >
 

Namespaces

 Detail
 

Functions

template<typename Type , typename TFunctor >
INLINE void parallelFor (IScheduler &scheduler, ThreadLocal< Type > &storage, const Size from, const Size to, TFunctor &&functor)
 Overload of parallelFor that passes thread-local storage into the functor. More...
 
template<typename Type , typename TFunctor >
INLINE void parallelFor (IScheduler &scheduler, ThreadLocal< Type > &storage, const Size from, const Size to, const Size granularity, TFunctor &&functor)
 Overload of parallelFor that passes thread-local storage into the functor. More...
 

Detailed Description

Template for thread-local storage.

Author
Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
Date
2016-2021

Definition in file ThreadLocal.h.

Function Documentation

◆ parallelFor() [1/2]

template<typename Type , typename TFunctor >
INLINE void parallelFor ( IScheduler scheduler,
ThreadLocal< Type > &  storage,
const Size  from,
const Size  to,
const Size  granularity,
TFunctor &&  functor 
)

Overload of parallelFor that passes thread-local storage into the functor.

Definition at line 198 of file ThreadLocal.h.

◆ parallelFor() [2/2]

template<typename Type , typename TFunctor >
INLINE void parallelFor ( IScheduler scheduler,
ThreadLocal< Type > &  storage,
const Size  from,
const Size  to,
TFunctor &&  functor 
)

Overload of parallelFor that passes thread-local storage into the functor.

Definition at line 187 of file ThreadLocal.h.