[Server] [Performance] Reduce locking in CustomNodeManager2#2895
[Server] [Performance] Reduce locking in CustomNodeManager2#2895romanett wants to merge 17 commits intoOPCFoundation:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2895 +/- ##
==========================================
- Coverage 55.43% 55.40% -0.04%
==========================================
Files 352 352
Lines 67602 67561 -41
Branches 13849 13830 -19
==========================================
- Hits 37477 37433 -44
- Misses 26021 26028 +7
+ Partials 4104 4100 -4 ☔ View full report in Codecov by Sentry. |
|
lets chat about this, I have some ideas... |
…GetManagerHandle threadsafe
|
Test Issue: Failed TestComponentCacheAsync [4 s] Stack Trace: |
| /// <param name="changes">The mask indicating what changes have occurred.</param> | ||
| public void OnMonitoredNodeChanged(ISystemContext context, NodeState node, NodeStateChangeMasks changes) | ||
| { | ||
| lock (NodeManager.Lock) |
There was a problem hiding this comment.
We need to enshure Data Changes reach each monitored Item in the right order i would sugesst a semaphore only for this method. No need to lock the entire node manager to enshure this behaviour (the node changes reach this method anyway)
| } | ||
|
|
||
| for (int ii = 0; ii < DataChangeMonitoredItems.Count; ii++) | ||
| foreach (MonitoredItem monitoredItem in DataChangeMonitoredItems?.Values) |
There was a problem hiding this comment.
Use Parallel.ForEach
Proposed changes
Types of changes
Checklist
Further comments
ToDo
Optimized Methods:
CustomNodeManger:
Parallel Tests:
To Decide: