e_config: add use_thread_max_cpu 56/215056/1 accepted/tizen/unified/20191004.003513 submit/tizen/20191001.045504
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 1 Oct 2019 07:34:49 +0000 (16:34 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 1 Oct 2019 07:47:09 +0000 (16:47 +0900)
capture use too many thread if many client is iconified at the same time
if use_thread_max_cpu is set, we limit ecore thread max by cpu counts

Change-Id: I1456424304aeece518cea7da13489462774c86b2

src/bin/e_config.c
src/bin/e_config.h
src/bin/e_main.c

index 537987c01587675d149e78de14b554dbd7b6d237..b394cc920e15f25647fbcabfbf5e3a543dc9a15f 100644 (file)
@@ -301,6 +301,7 @@ _e_config_edd_init(Eina_Bool old)
    E_CONFIG_VAL(D, T, configured_output_resolution.w, INT);
    E_CONFIG_VAL(D, T, configured_output_resolution.h, INT);
    E_CONFIG_VAL(D, T, global_object_not_provide.launch_effect, UCHAR);
+   E_CONFIG_VAL(D, T, use_thread_max_cpu, UCHAR);
 }
 
 static Eina_Bool
@@ -535,6 +536,7 @@ e_config_load(void)
    E_CONFIG_LIMIT(e_config->qp_handler.alpha, 0, 255);
    E_CONFIG_LIMIT(e_config->configured_output_resolution.use, 0, 1);
    E_CONFIG_LIMIT(e_config->global_object_not_provide.launch_effect, 0, 1);
+   E_CONFIG_LIMIT(e_config->use_thread_max_cpu, 0, 1);
 }
 
 E_API int
index 89ee23a28d8f43093e1daa7068b074a8b81ac82e..ba439068ce0699fc5601b67aa57e31f5f15c3ea9 100644 (file)
@@ -243,6 +243,8 @@ struct _E_Config
    {
       Eina_Bool launch_effect; // iface name : tizen_launch_effect
    } global_object_not_provide;
+
+   Eina_Bool use_thread_max_cpu; //set cpu count to ecore thread max
 };
 
 struct _E_Config_Desklock_Background
index 4ad63ad99b5758462361c890a902dbf9d93e75e7..a605198a6e3f55315cd3c9833d67014108e7f016 100644 (file)
@@ -756,6 +756,18 @@ main(int argc, char **argv)
    e_comp_all_thaw();
    TSE("E_Comp Thaw Done");
 
+   if (e_config->use_thread_max_cpu)
+     {
+        int cpus;
+
+        cpus = eina_cpu_count();
+        if (cpus >= 1)
+          {
+             TSM("Set ecore thread max");
+             ecore_thread_max_set(cpus);
+          }
+     }
+
    _idle_after = ecore_idle_enterer_add(_e_main_cb_idle_after, NULL);
 
    starting = EINA_FALSE;