Hi Zack,
The static classes you saw contain extension methods, which are stateless, so that has no impact on thread safety. NRules does not have any static or single instance state anywhere in the codebase.
With that being said, NRules needs to be used in a particular way in a multi-threaded environment. If it is used correctly - it is thread safe.
Roughly, the sequence of operations is as follows:
1. Load rules into an instance of RuleRepository. This operation is NOT thread safe, and is expected to be done only once, when bootstraping the application (or a web application)
2. Compile rules contained in the RuleRepository into an ISessionFactory. Again, NOT thread safe and only done once during the application bootstraping
3. Create a new rules session (ISession) from ISessionFactory - this IS thread safe. So, you can share the same ISessionFactory among multiple concurrent threads
4. Work with the ISession to assert facts and fire rules. This is NOT thread safe. There are two usage scenarios:
4.a. Short lived session. You create a new session within a single-threaded context (i.e. a service request handler, etc.), assert facts, fire rules and throw the session away. Every single-threaded context gets its own session, so multi-threading is not a concern
4.b. Long lived session. You share a long lived session among multiple threads - in this case, you MUST synchronize access to ISession, since ISession is not thread safe.
See:
Let me know if this answers your question.
Sergiy