On 8 May 2012 16:04, gboro54 <span dir="ltr">&lt;<a href="mailto:gboro54@gmail.com" target="_blank">gboro54@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Perhaps a blocking queue which has facts put on from other threads, the<br>
thread then inserts x number of facts and fires the rule set?<br></blockquote><div><br>Yes, I&#39;d say that&#39;s more like it. <br>
<br>
If these zillions of facts aren&#39;t related, they can be processed by disjoint sessions. So, <br>
if you want to feed more than one CPU, run several sessions like that. <br>
<br>
It might be desirable to have small batches of facts inserted and processed by a single<br>
call. You should know whether there is a way to do that...  <br><br>-W<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
gboro54 wrote<br>
<div><div class="h5">&gt;<br>
&gt; The point is to be able to stream a large volume of messages into the rule<br>
&gt; session without tying up that thread. In addition I don&#39;t want there to be<br>
&gt; millions of messages in a session at a given point, thus the point of<br>
&gt; executing the rules on a different thread while inserting facts from<br>
&gt; another.<br>
&gt;<br>
&gt;<br>
&gt; laune wrote<br>
&gt;&gt;<br>
&gt;&gt; What about executing insert(s) followed by fireAllRules() in one thread?<br>
&gt;&gt; -W<br>
&gt;&gt;<br>
&gt;&gt; On 08/05/2012, gboro54 &amp;lt;gboro54@&amp;gt; wrote:<br>
&gt;&gt;&gt; What do you recommend?  firUntilHalt seems to get locked out after<br>
&gt;&gt;&gt; sometime... I am running out of ideas and have posted this question<br>
&gt;&gt;&gt; before.<br>
&gt;&gt;&gt; I believe we talked about periodically using fireAllRules on a separate<br>
&gt;&gt;&gt; thread.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; laune wrote<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Periodically calling fireAllRules() in a thread running parallel to the<br>
&gt;&gt;&gt;&gt; one(s)<br>
&gt;&gt;&gt;&gt; doing insertions doesn&#39;t make sense to me.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; -W<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On 08/05/2012, gboro54 &amp;lt;gboro54@&amp;gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt; I am not currently using agenda-groups. I believe my issue right now<br>
&gt;&gt;&gt;&gt;&gt; is<br>
&gt;&gt;&gt;&gt;&gt; one<br>
&gt;&gt;&gt;&gt;&gt; of thread safety. A little background: I currently have a thread<br>
&gt;&gt;&gt;&gt;&gt; pulling<br>
&gt;&gt;&gt;&gt;&gt; messages from a database running on the main thread. In several other<br>
&gt;&gt;&gt;&gt;&gt; threads, I have drools session being fired every so often. It appears<br>
&gt;&gt;&gt;&gt;&gt; that<br>
&gt;&gt;&gt;&gt;&gt; there may be a some type of deadlock caused by invoking fireAllRules<br>
&gt;&gt;&gt;&gt;&gt; on<br>
&gt;&gt;&gt;&gt;&gt; one<br>
&gt;&gt;&gt;&gt;&gt; thread, while another is trying to insert. I am working through right<br>
&gt;&gt;&gt;&gt;&gt; now<br>
&gt;&gt;&gt;&gt;&gt; to<br>
&gt;&gt;&gt;&gt;&gt; debug the issue. Has anyone else experienced this issue?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Vincent Legendre wrote<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; I am having an issue where I have a catch all<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; retraction rule setup as the lowest salience.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Not sure to understand that (note that I am not english native ...)<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; I see activations created for the facts but they are never fired.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Any<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; thoughts on why this may happen?<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Send some rules. Activations never fired is just too vague to have a<br>
&gt;&gt;&gt;&gt;&gt;&gt; single answer.<br>
&gt;&gt;&gt;&gt;&gt;&gt; If you use agenda groups, may be that the group is simply not on<br>
&gt;&gt;&gt;&gt;&gt;&gt; focus<br>
&gt;&gt;&gt;&gt;&gt;&gt; ...<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Add a first rule that set the focus, or set auto-focus for all your<br>
&gt;&gt;&gt;&gt;&gt;&gt; &quot;low<br>
&gt;&gt;&gt;&gt;&gt;&gt; salience&quot; rules, or don&#39;t set agenda group for them (their group will<br>
&gt;&gt;&gt;&gt;&gt;&gt; be<br>
&gt;&gt;&gt;&gt;&gt;&gt; the MAIN group).<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; The session is run on a separate thread with fireAllRules called<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; every<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; 1/2<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; second. I have tried syncronizing inserts on the session so that<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; thread<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; would not be in the middle of firing when new facts come in but that<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; does<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; not seem to do anything....<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Why not using fireUntilHalt instead ?<br>
&gt;&gt;&gt;&gt;&gt;&gt; Run your session.fireUntilHalt in a separate thread, and insert<br>
&gt;&gt;&gt;&gt;&gt;&gt; things<br>
&gt;&gt;&gt;&gt;&gt;&gt; in<br>
&gt;&gt;&gt;&gt;&gt;&gt; that session.<br>
&gt;&gt;&gt;&gt;&gt;&gt; insert (or update or retract) will wake up the session.<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; Of course, one day, you have to call halt() on your session to get<br>
&gt;&gt;&gt;&gt;&gt;&gt; out.<br>
&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt;&gt;&gt;&gt; rules-users@.jboss<br>
&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; View this message in context:<br>
&gt;&gt;&gt;&gt;&gt; <a href="http://drools.46999.n3.nabble.com/agenda-groups-tp3968541p3971147.html" target="_blank">http://drools.46999.n3.nabble.com/agenda-groups-tp3968541p3971147.html</a><br>
&gt;&gt;&gt;&gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt;&gt;&gt; rules-users@.jboss<br>
&gt;&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt;&gt; rules-users@.jboss<br>
&gt;&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; View this message in context:<br>
&gt;&gt;&gt; <a href="http://drools.46999.n3.nabble.com/agenda-groups-tp3968541p3971245.html" target="_blank">http://drools.46999.n3.nabble.com/agenda-groups-tp3968541p3971245.html</a><br>
&gt;&gt;&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; rules-users mailing list<br>
&gt;&gt;&gt; rules-users@.jboss<br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; rules-users@.jboss<br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://drools.46999.n3.nabble.com/agenda-groups-tp3968541p3971415.html" target="_blank">http://drools.46999.n3.nabble.com/agenda-groups-tp3968541p3971415.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>