<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I think I've alread fixed this in trunk - when dealing with
add/removing stuff I now do a block syncronisation on the pkgs
instance. If that test is clean, we should add it to the list of
integration tests, to track regressions.<br>
<br>
Mark<br>
Edson Tirelli wrote:
<blockquote
cite="mid:e6dd5ba30707120943g7aa00397j2d9fb47fa517040c@mail.gmail.com"
type="cite"><br>
Dean<br>
<br>
Thanks, we will investigate that asap.<br>
<br>
[]s<br>
Edson<br>
<br>
<div><span class="gmail_quote">2007/7/12, Dean Jones <<a
moz-do-not-send="true" href="mailto:dean.m.jones@gmail.com">dean.m.jones@gmail.com</a>>:
</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi
Edson,<br>
<br>
On 7/12/07, Edson Tirelli <<a moz-do-not-send="true"
href="mailto:tirelli@post.com">tirelli@post.com
</a>> wrote:<br>
><br>
> Is it possible for you to provide a test case capable of
reproducing the<br>
> problem?<br>
><br>
I've written a quick test case, which is attached. When
numberOfThreads==1,<br>
everything compiles okay. When numberOfThreads==100, I get function
<br>
compilation errors and CompileExceptions from mvel. Clearly there is<br>
nothing shared between these threads as a new test class is created<br>
per thread. If you synchronise the calls to addPackage() and<br>
getPackage() using the class monitor i.e.<br>
<br>
synchronized (DroolsLoadTest.class) {<br>
builder.addPackage(packageDescr);<br>
builder.getPackage();<br>
}<br>
<br>
then the problems go away. Hope this helps.<br>
<br>
<br>
> At the same time, I would suggest you to not follow such
approach in your
<br>
> application. Compilation is an extremely heavy process and should
not be<br>
> done for each request. The ideal approach is to pre-compile (for
instance,<br>
> we have a contributed ant-task for that) and serialize your
rulebase to your
<br>
> database or filesystem, or at least, compile it only once and
cache it at<br>
> runtime.<br>
><br>
That's very sensible advice. Our situation is slightly different as<br>
users are allowed to change the rules used by a running service, so we
<br>
need to reflect any changes when a new request comes in. We are<br>
planning to apply caching if performance is an issue, but we were<br>
trying to assess performance of application under load when this<br>
thread safety issue arose.
<br>
<br>
Thanks for your help,<br>
<br>
Dean.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Edson Tirelli<br>
Software Engineer - JBoss Rules Core Developer<br>
Office: +55 11 3529-6000<br>
Mobile: +55 11 9287-5646
<br>
JBoss, a division of Red Hat @ <a moz-do-not-send="true"
href="http://www.jboss.com">www.jboss.com</a>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>