diff options
Diffstat (limited to 'public/gcsdk/gcparalleljobfarm.h')
| -rw-r--r-- | public/gcsdk/gcparalleljobfarm.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/public/gcsdk/gcparalleljobfarm.h b/public/gcsdk/gcparalleljobfarm.h new file mode 100644 index 0000000..5ffb847 --- /dev/null +++ b/public/gcsdk/gcparalleljobfarm.h @@ -0,0 +1,42 @@ +//====== Copyright (c), Valve Corporation, All rights reserved. ======= +// +// Purpose: Implements singleton datacache with support for yielding updates +// +//============================================================================= + +#ifndef GCPARALLELJOBFARM_H +#define GCPARALLELJOBFARM_H +#ifdef _WIN32 +#pragma once +#endif + + +namespace GCSDK +{ + +class IYieldingParallelFarmJobHandler +{ + // + // Derived class instances implementing farm job workload processing must + // be allocated on the heap as the calling job will yield for processing. + // +protected: + // + // BYieldingRunWorkload is called on different newly created farm jobs + // Param passed iJobSequenceCounter starts at 0 (zero) for the first framed job + // and is incremented by one for each subsequently farmed job. + // When the parallel processing should end job must set pbWorkloadCompleted to true + // and return true as success. + // Any farmed job returning false will abort further farmed processing and + // will result in BYieldingExecuteParallel returning false to the caller job. + // + virtual bool BYieldingRunWorkload( int iJobSequenceCounter, bool *pbWorkloadCompleted ) = 0; + +public: + bool BYieldingExecuteParallel( int numJobsParallel, char const *pchJobName = NULL, uint nTimeoutSec = 0 ); +}; + + +} // namespace GCSDK + +#endif // GCPARALLELJOBFARM_H |