gthreadpool: set default max_unused_threads and max_idle_time values

GThreadPool defaulted to 0 for max_unused_threads (meaning thread-pool
threads would exit immediately if there was not already another task
waiting for them), and 0 for max_idle_time (meaning unused threads
would linger forever, though this is only relevant if you changed
max_unused_threads).

However, GIOScheduler changed the global defaults to 2 and 15*1000,
respectively, arguing that these were more useful defaults. And they
are, so let's use them.

https://bugzilla.gnome.org/show_bug.cgi?id=661767
This commit is contained in:
Dan Winship
2012-07-25 14:41:04 -04:00
parent 26056558be
commit b3f9637337
2 changed files with 5 additions and 10 deletions

View File

@@ -113,12 +113,6 @@ init_scheduler (gpointer arg)
g_thread_pool_set_sort_function (job_thread_pool,
g_io_job_compare,
NULL);
/* It's kinda weird that this is a global setting
* instead of per threadpool. However, we really
* want to cache some threads, but not keep around
* those threads forever. */
g_thread_pool_set_max_idle_time (15 * 1000);
g_thread_pool_set_max_unused_threads (2);
}
}
return NULL;