Added environmen variable into the stratagus launcer to reduce CPU load while already finished threads are wating for still working yet ones.
This commit is contained in:
parent
34ae082a84
commit
dbf039097e
1 changed files with 5 additions and 2 deletions
|
@ -661,13 +661,16 @@ int main(int argc, char * argv[]) {
|
|||
}
|
||||
stratagus_argv[argc + 2] = NULL;
|
||||
|
||||
// Needed to reduce CPU load while idle threads are wating for havn't finished yet ones
|
||||
char *const env[] = { (char*)"OMP_WAIT_POLICY=passive", NULL };
|
||||
|
||||
#ifdef WIN32
|
||||
int ret = _spawnvp(_P_WAIT, stratagus_bin, stratagus_argv);
|
||||
int ret = _spawnvpe(_P_WAIT, stratagus_bin, stratagus_argv, env);
|
||||
#else
|
||||
int ret = 0;
|
||||
int childpid = fork();
|
||||
if (childpid == 0) {
|
||||
execvp(stratagus_bin, stratagus_argv);
|
||||
execvpe(stratagus_bin, stratagus_argv, env);
|
||||
if (strcmp(stratagus_bin, "stratagus") == 0) {
|
||||
realpath(argv[0], stratagus_bin);
|
||||
parentdir(stratagus_bin);
|
||||
|
|
Loading…
Reference in a new issue