mps.sync.mutex
Create a persistence service mutex
Syntax
Description
creates a database advisory lock object.lk
= mps.sync.mutex(mutexName
,'Connection',connectionName
)
creates a database advisory lock object.lk
= mps.sync.mutex(mutexName
,'Connection',connectionName
,'Expiration',expirationTime
)
Examples
Input Arguments
Output Arguments
Tips
A persistence service mutex allows multiple clients to take turns using a shared resource. Each cooperating client creates a mutex object with the same name using a connection to a shared persistence service. To gain exclusive access to the shared resource, a client attempts to acquire a lock on the mutex. When the client finishes operating on the shared resource, it releases the lock. To prevent lockouts should the locking client crash, all locks expire after a certain amount of time.
Acquiring a lock on a mutex prevents other clients from acquiring a lock on that mutex but it does not lock the persistence service or any keys or values stored in the persistence service. These locks are advisory only and are meant to be used by cooperating clients intent of preventing data corruption. Rogue clients will be able to corrupt or delete data if they do not voluntarily respect the mutex locks.
Version History
Introduced in R2018b