diff --git a/common/threads.c b/common/threads.c index 00420d9c..6a901e8d 100644 --- a/common/threads.c +++ b/common/threads.c @@ -82,6 +82,12 @@ InterruptThreadProgress__(void) int numthreads = 1; CRITICAL_SECTION crit; +void +LowerProcessPriority(void) +{ + SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS); +} + int GetDefaultThreads(void) { @@ -170,6 +176,12 @@ RunThreadsOn(int start, int workcnt, void *(func)(void *), void *arg) int numthreads = 1; pthread_mutex_t *my_mutex; +void +LowerProcessPriority(void) +{ + /* not implemented for now */ +} + int GetDefaultThreads(void) { diff --git a/include/common/threads.h b/include/common/threads.h index ef1c7242..b0b37908 100644 --- a/include/common/threads.h +++ b/include/common/threads.h @@ -5,6 +5,7 @@ extern int numthreads; +void LowerProcessPriority(void); int GetDefaultThreads(void); int GetMaxThreads(void); /* returns 0 if no limit specified */ int GetThreadWork(void); diff --git a/light/light.c b/light/light.c index 47ac8858..d1e17efa 100644 --- a/light/light.c +++ b/light/light.c @@ -270,6 +270,7 @@ main(int argc, const char **argv) init_log("light.log"); logprint("---- light / TyrUtils " stringify(TYRUTILS_VERSION) " ----\n"); + LowerProcessPriority(); numthreads = GetDefaultThreads(); for (i = 1; i < argc; i++) { diff --git a/vis/vis.c b/vis/vis.c index db96264f..3a0a0dbe 100644 --- a/vis/vis.c +++ b/vis/vis.c @@ -1182,6 +1182,7 @@ main(int argc, char **argv) init_log("vis.log"); logprint("---- vis / TyrUtils " stringify(TYRUTILS_VERSION) " ----\n"); + LowerProcessPriority(); numthreads = GetDefaultThreads(); for (i = 1; i < argc; i++) {