Nebula
Loading...
Searching...
No Matches
jobs2.h File Reference

Go to the source code of this file.

Classes

struct  Jobs2::CallableStub< ARGS >
 
struct  Jobs2::Callable< LAMBDA, ARGS >
 
struct  Jobs2::Lambda
 
struct  Jobs2::JobContext
 
struct  Jobs2::JobNode
 
struct  Jobs2::Jobs2Context
 
class  Jobs2::JobThread
 
struct  Jobs2::JobSystemInitInfo
 

Namespaces

namespace  Threading
 The Jobs2 system provides a set of threads and a pool of jobs from which threads can pickup work.
 
namespace  Jobs2
 

Macros

#define JOB_SIGNATURE   (SizeT totalJobs, SizeT groupSize, IndexT groupIndex, SizeT invocationOffset)
 
#define JOB_BEGIN_LOOP
 
#define JOB_END_LOOP   }
 
#define JOB_ITEM_INDEX   __INDEX
 

Typedefs

typedef volatile long Jobs2::CompletionCounter
 
using Jobs2::JobFunc = void(*)(SizeT totalJobs, SizeT groupSize, IndexT groupIndex, SizeT invocationOffset, void* ctx)
 

Functions

void * Jobs2::JobAlloc (SizeT bytes)
 Allocate memory.
 
void Jobs2::JobSystemInit (const JobSystemInitInfo &info)
 Create a new job port.
 
void Jobs2::JobSystemUninit ()
 Destroy job port.
 
template<typename T >
T * Jobs2::JobAlloc (SizeT count)
 Allocate memory and progress memory iterator.
 
void Jobs2::JobNewFrame ()
 Progress to new buffer.
 
void Jobs2::JobBeginSequence (const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 Begin a sequence of jobs.
 
template<typename CTX >
void Jobs2::JobAppendSequence (const JobFunc &func, const SizeT numInvocations, const SizeT groupSize, const CTX &context)
 Append job to sequence with an automatic dependency on the previous job.
 
template<typename CTX >
void Jobs2::JobAppendSequence (const JobFunc &func, const SizeT numInvocations, const CTX &context)
 Append job to sequence with an automatic dependency on the previous job, to run on a single thread.
 
void Jobs2::JobEndSequence (Threading::Event *signalEvent=nullptr)
 Flush queued jobs.
 
template<typename LAMBDA >
void Jobs2::JobDispatch (LAMBDA &&func, const SizeT numInvocations, const SizeT groupSize, const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 
template<typename LAMBDA >
void Jobs2::JobDispatch (LAMBDA &&func, const SizeT numInvocations, const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 
template<typename CTX >
void Jobs2::JobDispatch (const JobFunc &func, const SizeT numInvocations, const SizeT groupSize, const CTX &context, const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 
template<typename CTX >
void Jobs2::JobDispatch (const JobFunc &func, const SizeT numInvocations, const CTX &context, const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 

Macro Definition Documentation

◆ JOB_BEGIN_LOOP

#define JOB_BEGIN_LOOP
Value:
for (IndexT i = 0; i < groupSize; i++)\
{\
IndexT __INDEX = i + invocationOffset;\
if (__INDEX >= totalJobs)\
return;\
int IndexT
Definition types.h:48

◆ JOB_END_LOOP

#define JOB_END_LOOP   }

◆ JOB_ITEM_INDEX

#define JOB_ITEM_INDEX   __INDEX

◆ JOB_SIGNATURE

#define JOB_SIGNATURE   (SizeT totalJobs, SizeT groupSize, IndexT groupIndex, SizeT invocationOffset)