[rules-users] Starting engine using fireUntilHalt and inserting no facts results in 50% CPU usage

Wolfgang Laun wolfgang.laun at gmail.com
Mon Oct 25 12:41:58 EDT 2010


I think you should not worry about the CPU % in the first place. If there's
nothing
else to do, a serf might very well busy himself by -- looking for work ;-)

More technically, scheduling as it is frequently used in an operating system
will
assign the CPU according to a strategy, which "punishes" processes
monopolizing
the CPU by not doing any I/O. This means that any such process is downgraded
in its scheduling priority, whereas "well-behaved" processed will be
upgraded
due to their wait times because of I/O.

Inserting one fact and calling fireAllRules may be a good strategy, but it
isn't
essential for achieving anything except short reaction time or results not
influenced or muddled by other facts. (For the latter, your rules may have
to
take precautions!)

-W

On 25 October 2010 18:13, Tina Vießmann <tviessmann at stud.hs-bremen.de>wrote:

>
> > You can call fireAllRules after every event changing the state of the
> facts
> > or of the ruleflow.
> So it's not recommended to insert more than one event and then calling
> fireAllRules()?!
>
> > When you do event stream processing and use the time
> > inside your rules, the time is a change event too. So you have to use
> > fireUntilHalt if you can't afford to have the small pauses using
> > fireAllRules/Sleep in a loop.
> Currently, I'm using the stream processing mode. But I'm not using
> windows, I'm just using temporal operations.
> Would you recommend me to use fireAlleRules+Sleep if I want to use
> fireAllRules or can I also use it without the sleep?
>
> Thanks. :)
> Tina
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20101025/f85b8469/attachment.html 


More information about the rules-users mailing list