diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/gcsdk/gcparalleljobfarm.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
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 |