cmlibs / zinc

Source code repository for OpenCMISS-Zinc
Mozilla Public License 2.0
15 stars 18 forks source link

API to force fieldmodule change notification #247

Closed rchristie closed 1 year ago

rchristie commented 1 year ago

Optimisations such as the FindMeshLocation's use of an element field range cache are only enabled when the field has no active modifications. A single modification to the field on any node or element during begin/endChange is sufficient to kill this optimisation. At this time, clients must carefully ensure the last endChange is called to trigger notification of changes to clients which clears all active modifications. It's easy for further clients to ruin this by further nesting begin/endChange.

It is proposed to add an API e.g. Fieldmodule.forceChangeNotification() which doesn't change the current cache level but notifies and flushes and changes. This API could also return the current change cache level for diagnosing issues.

Alternatively could just add a Fieldmodule.getChangeLevel() method and require the client to call the right number of endChanges then beginChanges.

rchristie commented 1 year ago

We've decided not to proceed as other means should be used to ensure optimisations can be used while changes are in progress.