diff options
author | Marek Olšák <[email protected]> | 2017-09-06 23:09:41 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-09-07 12:57:14 +0200 |
commit | 7b4b8f6373a960e8996169a5b7fadd6bcca42d94 (patch) | |
tree | faaefdc6a423185691a41ba56a1c947fadc9d152 /src/util | |
parent | e96d175c7d2edf4639721bad83aa41e341e47952 (diff) |
disk_cache: make the thread queue resizable and low priority
Acked-by: Timothy Arceri <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/disk_cache.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c index b789a454eb0..33e4dc8e7df 100644 --- a/src/util/disk_cache.c +++ b/src/util/disk_cache.c @@ -358,13 +358,15 @@ disk_cache_create(const char *gpu_name, const char *timestamp, cache->max_size = max_size; - /* A limit of 32 jobs was choosen as observations of Deus Ex start-up times - * showed that we reached at most 11 jobs on an Intel i5-6400 [email protected] - * (a fairly modest desktop CPU). 1 thread was chosen because we don't - * really care about getting things to disk quickly just that it's not - * blocking other tasks. + /* 1 thread was chosen because we don't really care about getting things + * to disk quickly just that it's not blocking other tasks. + * + * The queue will resize automatically when it's full, so adding new jobs + * doesn't stall. */ - util_queue_init(&cache->cache_queue, "disk_cache", 32, 1, 0); + util_queue_init(&cache->cache_queue, "disk_cache", 32, 1, + UTIL_QUEUE_INIT_RESIZE_IF_FULL | + UTIL_QUEUE_INIT_USE_MINIMUM_PRIORITY); uint8_t cache_version = CACHE_VERSION; size_t cv_size = sizeof(cache_version); |