X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=taskqueue.c;h=175a28af7c21c74aea3562ea4423b99c4c701a24;hb=1b2c7d6b6950d0da828d9b2b4ec28e633d0fec62;hp=74a72b1b3f8b6fa0db517cf889322f062516548b;hpb=0a05c446ba26bd5897645a37ceec8646c5bc93eb;p=xonotic%2Fdarkplaces.git diff --git a/taskqueue.c b/taskqueue.c index 74a72b1b..175a28af 100644 --- a/taskqueue.c +++ b/taskqueue.c @@ -1,9 +1,9 @@ #include "quakedef.h" #include "taskqueue.h" -cvar_t taskqueue_minthreads = {CVAR_CLIENT | CVAR_SERVER | CVAR_SAVE, "taskqueue_minthreads", "0", "minimum number of threads to keep active for executing tasks"}; -cvar_t taskqueue_maxthreads = {CVAR_CLIENT | CVAR_SERVER | CVAR_SAVE, "taskqueue_maxthreads", "32", "maximum number of threads to start up as needed based on task count"}; -cvar_t taskqueue_tasksperthread = {CVAR_CLIENT | CVAR_SERVER | CVAR_SAVE, "taskqueue_tasksperthread", "4000", "expected amount of work that a single thread can do in a frame - the number of threads being used depends on the average workload in recent frames"}; +cvar_t taskqueue_minthreads = {CF_CLIENT | CF_SERVER | CF_ARCHIVE, "taskqueue_minthreads", "0", "minimum number of threads to keep active for executing tasks"}; +cvar_t taskqueue_maxthreads = {CF_CLIENT | CF_SERVER | CF_ARCHIVE, "taskqueue_maxthreads", "32", "maximum number of threads to start up as needed based on task count"}; +cvar_t taskqueue_tasksperthread = {CF_CLIENT | CF_SERVER | CF_ARCHIVE, "taskqueue_tasksperthread", "4000", "expected amount of work that a single thread can do in a frame - the number of threads being used depends on the average workload in recent frames"}; #define MAXTHREADS 1024 #define RECENTFRAMES 64 // averaging thread activity over this many frames to decide how many threads we need @@ -96,7 +96,7 @@ static int TaskQueue_ThreadFunc(void *d) break; sleepcounter++; if (sleepcounter >= THREADSLEEPCOUNT) - Sys_Sleep(1000); + Sys_Sleep(0.001); sleepcounter = 0; } return 0;