Closed udi-speedb closed 10 months ago
The example of changing the cache size can be accomplished without using SharedOptions. Given a Cache, I can call SetCapacity() and change its size and the PinningPolicy will be none the wiser. That issue (of associating a PinningPolicy with the Cache) should be raised separately and is independent of SharedOptions (the same could be said of thread counts and Env).
The SharedOptions class currently allows modifications that are not controlled, and may cause inconsistencies. It provides great flexibility, but is inherently unsafe. For example, a user may change the size of the cache without an associated required change in the pinning policy capacity.
Until we provide safe and consistent interfaces to allow that flexibility, we will constrain the interface of SharedOptions. The result will be an immutable SharedOptions but one that is safe and easy to use correctly.