Using the same ruleset for several rule engines

To reduce memory consumption, you can create several engines that run in parallel and that use the same ruleset.

About this task

When several engines use the same ruleset, it reduces the memory consumption, but it might slightly degrade the performance in the case of multithreaded execution.

Rule Execution Server directly supports concurrent executions.

If you do not want to use Rule Execution Server, use an engine, as an IlrContext instance, in only one thread.

Do not use the same objects in different engines in different threads.

Procedure

To make several engines use the same ruleset, use the following code:
IlrRuleset ruleset = ...
IlrContext engine1 = new IlrContext(ruleset);
IlrContext engine2 = new IlrContext(ruleset);