ecore_con/efl_net - dedicated threads for network i/o not from the pool
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 3 Feb 2017 05:57:49 +0000 (14:57 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 3 Feb 2017 05:57:49 +0000 (14:57 +0900)
so ecore_con/efl_net were using the standard ecore_thread thread pool
for doing things like dns lookups (that can take multiple minutes
until timeouts) and actual http transactions. similarly they can block
thread workers for long periods or indefinitely thus basically
blocking the whole eocre_thread pool and stopping others from sharing
it. the best solution we have right now is to bypass the thread pool
queue and have dedicated threads for these actions. what we should
have is a dedicated thread pool with each thread taking on N
connections (via select etc.) and the ability to create and destroy
thread pools for specific tasks so you can separate the work out from
other work.  but that is basically a redesign of our thread pool infra
so let's do the quick solution here until that day comes.

this partially addresses D4640

a dedicated thread per image load though is going to be a lot nastier...

src/lib/ecore_con/ecore_con.c
src/lib/ecore_con/efl_net_dialer_http.c

index dd641da..35eb4d0 100644 (file)
@@ -703,10 +703,11 @@ efl_net_ip_resolve_async_new(const char *host, const char *port, const struct ad
 
    d->result = NULL;
 
-   return ecore_thread_run(_efl_net_ip_resolve_async_run,
-                           _efl_net_ip_resolve_async_end,
-                           _efl_net_ip_resolve_async_cancel,
-                           d);
+   return ecore_thread_feedback_run(_efl_net_ip_resolve_async_run,
+                                    NULL,
+                                    _efl_net_ip_resolve_async_end,
+                                    _efl_net_ip_resolve_async_cancel,
+                                    d, EINA_TRUE);
 
  failed_hints:
    free(d->port);
index 2454c72..6c4a463 100644 (file)
@@ -1407,10 +1407,11 @@ _efl_net_dialer_http_efl_net_dialer_dial(Eo *o, Efl_Net_Dialer_Http_Data *pd, co
 
         ctx->o = o;
 
-        pd->libproxy_thread = ecore_thread_run(_efl_net_dialer_http_libproxy_run,
-                                               _efl_net_dialer_http_libproxy_end,
-                                               _efl_net_dialer_http_libproxy_cancel,
-                                               ctx);
+        pd->libproxy_thread = ecore_thread_feedback_run(_efl_net_dialer_http_libproxy_run,
+                                                        NULL,
+                                                        _efl_net_dialer_http_libproxy_end,
+                                                        _efl_net_dialer_http_libproxy_cancel,
+                                                        ctx, EINA_TRUE);
         return 0;
      url_error:
         free(ctx);