getMutexCounts(jdo: JadeDynamicObject input; includeZeroContentions: Boolean);
The getMutexCounts method of the Node class retrieves the number of contentions on mutexes used internally by JADE for the particular node identified as the method receiver. A mutex is a locking mechanism used to ensure thread safety when executing critical sections of code.
The contention counts are returned as
The contention counts are cumulative from the time the specified node is initiated.
The includeZeroContentions parameter indicates whether mutexes that have not yet encountered any contentions should be included in the information returned. If set to false, only information for those mutexes that have had at least one contention are added to the dynamic object. If this parameter is set to true, information about all current mutexes is added.
The calling process is responsible for creating and deleting the
The number of mutexes reported and the order that the properties are added to the dynamic object can vary from call to call, because mutexes can be dynamically created and deleted.
If a mutex is deleted then recreated between getMutexCounts calls, the contention count can appear to reduce in value. Any application attempting to calculate contention count differences should take this into account.
The mutex contention information is primarily for internal use. High mutex contention counts can indicate bottlenecks that are impacting overall system performance.
The following example shows the use of the getMutexCounts method.
tryMutexCounts(); vars jdo : JadeDynamicObject; begin create jdo transient; node.getMutexCounts(jdo, false); write jdo.display; epilog delete jdo; end;
The output from the getMutexCounts method shown in the previous example is as follows.
---MutexStatistics(111)--- InterpreterOutp = 13 DrawTextLock = 17 PDB BuffChgLock = 1 PersistentCache = 102 PersistentDelet = 7 ClientTransient = 9 tblMgtLock = 2