GDAL
gdal_thread_pool.h
1/**********************************************************************
2 *
3 * Project: GDAL
4 * Purpose: Global thread pool
5 * Author: Even Rouault, <even dot rouault at spatialys dot com>
6 *
7 **********************************************************************
8 * Copyright (c) 2020, Even Rouault, <even dot rouault at spatialys dot com>
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDAL_THREAD_POOL_H
14#define GDAL_THREAD_POOL_H
15
16#include "cpl_port.h"
17
19const int GDAL_DEFAULT_MAX_THREAD_COUNT = 1024;
20
22
23CPLWorkerThreadPool CPL_DLL *GDALGetGlobalThreadPool(int nThreads);
24
25void GDALDestroyGlobalThreadPool();
26
27int CPL_DLL GDALGetNumThreads(int nMaxVal = -1, bool bDefaultAllCPUs = false,
28 const char **ppszValue = nullptr,
29 bool *pbOK = nullptr);
30
31int CPL_DLL GDALGetNumThreads(const char *pszNumThreads, int nMaxVal = -1,
32 bool bDefaultAllCPUs = false,
33 const char **ppszValue = nullptr,
34 bool *pbOK = nullptr);
35
36int CPL_DLL GDALGetNumThreads(CSLConstList papszOptions,
37 const char *pszItemName = "NUM_THREADS",
38 int nMaxVal = -1, bool bDefaultAllCPUs = false,
39 const char **ppszValue = nullptr,
40 bool *pbOK = nullptr);
41
42#endif // GDAL_THREAD_POOL_H
Pool of worker threads.
Definition cpl_worker_thread_pool.h:64
Core portability definitions for CPL.
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1252