<font size=2 face="sans-serif">Hi Daniel,</font>
<br>
<br><font size=2 face="sans-serif">I was reading the other day that a JVM
implementation does not necessarily have to run Java threads in different
Processes (taking advantage of multiple cores). &nbsp;If you saw a significant
speedup then I would assume your JVM does this. &nbsp;It is worth investigating
for your production deployment. &nbsp;I would think that recent JVMs on
modern operating systems would support this, but I also wouldn't leave
it up to chance.</font>
<br>
<br><font size=2 face="sans-serif">This post seems to imply that the only
JVM/OS combinations that don't support native threads are Java 1.2 or Solaris:
</font><a href="http://forums.sun.com/thread.jspa?threadID=5330507"><font size=2 face="sans-serif">http://forums.sun.com/thread.jspa?threadID=5330507</font></a>
<br>
<br><font size=2 face="sans-serif">About StatefulKnowledgeSessions: You
should be able to run these in parallel no problem.</font>
<br>
<br><font size=2 face="sans-serif">-Steve</font>
<br>
<br><tt><font size=2>rules-users-bounces@lists.jboss.org wrote on 05/11/2010
07:55:18 AM:<br>
<br>
&gt; From:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; djb &lt;dbrownell83@hotmail.com&gt;</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; To:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; rules-users@lists.jboss.org</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Date:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; 05/11/2010 08:01 AM</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Subject:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Re: [rules-users] Parallelization</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Sent by:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; rules-users-bounces@lists.jboss.org</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; <br>
&gt; Hi Wolfgang,<br>
&gt; <br>
&gt; Ok, well I implemented my &quot;option #2&quot;, which has cut it
down to 23ms, which<br>
&gt; is a good start. &nbsp;My timing is done by taking the time before,
and after,<br>
&gt; and dividing by the number of claims processed. &nbsp;(and averaging
over a few<br>
&gt; runs)<br>
&gt; <br>
&gt; I use one thread per StatefulKnowledgeSession... My machine has 2
cores, but<br>
&gt; it will eventually be running on an 8 core beast, so i reckon this
was a<br>
&gt; good improvement. &nbsp;I was just worried that I wouldn't be able
to<br>
&gt; simultaneously process multiple K-Sessions, but apparently, Drools
doesn't<br>
&gt; mind. &nbsp;I'm pretty sure any machine with multiple cores supports
parallel<br>
&gt; java threads, no? <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; -----<br>
&gt; Regarding my Utilities method, eg. &nbsp;isWithinTimePeriod(&quot;20100308&quot;,<br>
&gt; &quot;20090405&quot;, 1, &quot;Y&quot;)<br>
&gt; <br>
&gt; I can get about 5ms off by commenting out the eval, so it's not going
to be<br>
&gt; a big jump even if I fix it, but, well, I am using yyyyMMdd Strings,
which<br>
&gt; in the method, I sub-stringed, converted to ints, instantiated DateMidnight<br>
&gt; objects, and compared using Joda-time daysBetween/monthsBetween/yearsBetween<br>
&gt; methods. &nbsp;<br>
&gt; <br>
&gt; My thought was that pre-converting to ints would help, so that each<br>
&gt; ClaimLine has year/month/day int variables, and pass them in instead.
(i.e.,<br>
&gt; Saves 3 String.substring()'s, and 3 Integer.parseInt()). &nbsp;but
that actually<br>
&gt; slowed it down a few milliseconds. (Maybe passing 6 params instead
of 2?!)<br>
&gt; <br>
&gt; I'm comparing two dates by an arbitrary period, like &quot;2 days&quot;
or &quot;1 month&quot;,<br>
&gt; and need the framework of the Gregorian Calendar. &nbsp;So, I don't
think I can<br>
&gt; do anything about this. &nbsp;2 months is never guaranteed to be a
set number of<br>
&gt; milliseconds. &nbsp;It all depends on the claim date, which is fact
data, and<br>
&gt; therefore variable.<br>
&gt; <br>
&gt; Regards,<br>
&gt; Daniel<br>
&gt; <br>
&gt; -- <br>
&gt; View this message in context: </font></tt><a href="http://drools-java-rules-engine/"><tt><font size=2>http://drools-java-rules-engine</font></tt></a><tt><font size=2>.<br>
&gt; 46999.n3.nabble.com/Parallelization-tp809341p809753.html<br>
&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; rules-users@lists.jboss.org<br>
&gt; </font></tt><a href="https://lists.jboss.org/mailman/listinfo/rules-users"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/rules-users</font></tt></a><tt><font size=2><br>
</font></tt>