<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><div style="direction:ltr"><br></div><div style="direction:ltr">+1</div><div style="direction:ltr">Sounds very effective. And this is one of strongest points of jboss.</div><div style="direction:ltr"><br></div><div style="direction:ltr">Im very curious to see the engine performance of it. </div><br><div>Regards,</div>-Eldad</div><div><br>On 16 בינו׳ 2017, at 11:46, Roy Golan &lt;<a href="mailto:rgolan@redhat.com">rgolan@redhat.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div><div>Java EE 7 included ManageExecutorService in its spec. Using Wildfly (as certified EE 7 container) we can use it to replace our own ThreadPoolUtil implementation and (possibly) Quarz usage. <br><br></div>Managed executor service is a thread pool resource, manage by the container and can be controlled via JMX or the startup <a href="http://ovirt-egine.xml.in">ovirt-egine.xml.in</a> facility. This means that it could be tweaked at runtime as well. The service has configured thread factory and queue as well, all described by the xml<br><br></div><div>In the engine we are using mutli pools, with little to no capabilities of tweaking them<br>- ThreadPoolUtil - our general threading facade<br></div><div>- SchedulerThreadPool - the pool we create to pass to quarz<br>- HostUpdatesCheckerService.java - internal pool<br></div><div>- CommandExecutor - coco&#39;s pool<br><br></div><div>EE gave us a standard way to handle threads, with runtime configuration and ability to @inject it into the code, this means once again less code with using something the platform already supplies with real tuninig abilities. I know #infra has an item quarts, this should be considered as well.<br></div><div><br></div><div>Following this thread, if there is no suitable bug already, I&#39;ll open one for this.<br><br></div><div>Some code snippets:  <br></div><pre><code>@Resource
private ManagedExecutorService mes;<br></code></pre><pre><code>...  Future f = mes.submit(() -&gt; doThis())</code><br></pre><div><br></div><div>The configuration in <a href="http://ovirt-engine.xml.in">ovirt-engine.xml.in</a> (already there today!):<br><br></div><div><div class="gmail-container" title="Hint: double-click to select code"><div class="gmail-line gmail-number1 gmail-index0 gmail-alt2"><code class="gmail-xml gmail-plain">&lt;</code><code class="gmail-xml gmail-keyword">managed-executor-services</code><code class="gmail-xml gmail-plain">&gt;</code></div><div class="gmail-line gmail-number2 gmail-index1 gmail-alt1"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-plain">&lt;</code><code class="gmail-xml gmail-keyword">managed-executor-service</code></div><div class="gmail-line gmail-number3 gmail-index2 gmail-alt2"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">name</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;default&quot;</code></div><div class="gmail-line gmail-number4 gmail-index3 gmail-alt1"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">jndi-name</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;java:jboss/ee/concurrency/executor/default&quot;</code></div><div class="gmail-line gmail-number5 gmail-index4 gmail-alt2"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">context-service</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;default&quot;</code></div><div class="gmail-line gmail-number6 gmail-index5 gmail-alt1"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">thread-factory</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;default&quot;</code></div><div class="gmail-line gmail-number7 gmail-index6 gmail-alt2"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">hung-task-threshold</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;60000&quot;</code></div><div class="gmail-line gmail-number8 gmail-index7 gmail-alt1"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">core-threads</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;5&quot;</code></div><div class="gmail-line gmail-number9 gmail-index8 gmail-alt2"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">max-threads</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;25&quot;</code></div><div class="gmail-line gmail-number10 gmail-index9 gmail-alt1"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">keepalive-time</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;5000&quot;</code></div><div class="gmail-line gmail-number11 gmail-index10 gmail-alt2"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">queue-length</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;1000000&quot;</code></div><div class="gmail-line gmail-number12 gmail-index11 gmail-alt1"><code class="gmail-xml gmail-spaces">  </code><code class="gmail-xml gmail-color1">reject-policy</code><code class="gmail-xml gmail-plain">=</code><code class="gmail-xml gmail-string">&quot;RETRY_ABORT&quot;</code> <code class="gmail-xml gmail-plain">/&gt;</code></div><div class="gmail-line gmail-number13 gmail-index12 gmail-alt2"><code class="gmail-xml gmail-plain">&lt;/</code><code class="gmail-xml gmail-keyword">managed-executor-services</code><code class="gmail-xml gmail-plain">&gt;<br><br></code></div><div class="gmail-line gmail-number13 gmail-index12 gmail-alt2"><code class="gmail-xml gmail-plain">Please head here for wildfly docs [1] and here [2] to see a simple example (from one of the members of the EG of EE, recommended blog in general)<br><br>[1] <a href="https://docs.jboss.org/author/display/WFLY8/EE+Concurrency+Utilities+Configuration">https://docs.jboss.org/author/display/WFLY8/EE+Concurrency+Utilities+Configuration</a><br>[2] <a href="http://www.adam-bien.com/roller/abien/entry/injecting_an_executorservice_with_java">http://www.adam-bien.com/roller/abien/entry/injecting_an_executorservice_with_java</a><br><br></code></div><div class="gmail-line gmail-number13 gmail-index12 gmail-alt2"><code class="gmail-xml gmail-plain"><br></code></div></div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Devel mailing list</span><br><span><a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a></span><br><span><a href="http://lists.ovirt.org/mailman/listinfo/devel">http://lists.ovirt.org/mailman/listinfo/devel</a></span></div></blockquote></body></html>