Created
May 30, 2020 02:41
-
-
Save turtlesoupy/03f383e890875b15fe51971fe5df8e3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <string> | |
#include <thread> | |
namespace skimpy { | |
class GlobalConfig { | |
public: | |
static inline GlobalConfig& get() { | |
static GlobalConfig instance; | |
return instance; | |
} | |
int getParallelizeThreshold() { | |
return parallelizeThreshold_; | |
} | |
void setParallelizeThreshold(int threshold) { | |
parallelizeThreshold_ = threshold; | |
} | |
int getParallelizeParts() { | |
return parallelizeParts_; | |
} | |
void setParallelizeParts(int parts) { | |
parallelizeParts_ = parts; | |
} | |
private: | |
GlobalConfig() | |
: parallelizeThreshold_(8 * 1024), | |
parallelizeParts_(std::thread::hardware_concurrency()){ | |
}; | |
int parallelizeThreshold_; | |
int parallelizeParts_; | |
}; | |
} // namespace skimpy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment