The default behaviour of a FullTextIndex instance is for thread safety to be enabled. This is implemented in such a way as to allow simultaneous reading, but exclusive writing from different threads.
This locking mechanism is implemented by the Lifti.Locking.LockManager
class, which implements Lifti.Locking.ILockManager
. The FullTextIndex class has a reference to its own lock manager, stored against its LockManager property.
Typically you will not need to interact with this directly, however if:
- you are operating in a single threaded environment
- or you can guarantee that all interactions with the index will occur on the same thread
- or you will only ever be reading from the index
then in any of the above situations you can slightly improve performance by disabling locking, by settingfullTextIndex.LockManager.IsEnabled = false