Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Tutorials
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Multi-threading in protocol

Solved1.00K views28th August 2023multi-thread protocol help
2
Ruben Vandepitte [SLC] [DevOps Advocate]2.28K 24th August 2023 0 Comments

Hi, I have a few questions wrt multi-threading, on behalf of one of our users.

---

We are seeing some strange behaviour in Dataminer where attempting to access tables results in errors citing an inconsistent number of rows

2023/08/24 02:09:56.417|SLProtocol - 11336 - Resource Manager|14568|ARRAY::SetAt|ERR|-1|[Cell update] Table [JobPlanningFileStatusTable [11500]] [Column: JobPlanningFileStatusTableLastUpdateNM01 [11505]] Set on row 1511 [only 1510 row(s) available]

I suspect this could be because these tables are updated by multiple threads and we haven’t put any locks in to ensure they are threadsafe.

I have a couple of specific questions on how Dataminer handles concurrent threads:

  1. Scenario 1:
    1. A thread created explicitly in .NET updates Parameter1
    2. Action1 is triggered by the update to Parameter1 and adds a new row into Table1
    3. Action2 is triggered by Timer1 and deletes some rows from Table1
    4. Could Action1 and Action2 trigger in parallel (and so be updating Table1 at the same time)?
  2. Scenario 2:
    1. Element2 updates Parameter1 which is on Element1
    2. Action1 on Element1 is triggered by the update to Parameter1 and adds a row to Table1
    3. Action2 on Element1 is triggered by Timer1 and deletes some rows from Table1
    4. Could Action1 and Action2 trigger in parallel (and so update Table1 at the same time)?

---

Thanks!

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 28th August 2023

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
1
Floris Cockaerts [SLC] [DevOps Advocate]2.43K Posted 24th August 2023 2 Comments

Hi Ruben,

We always try to maintain the integrity of the data by using the necessary locking in our server code while trying to keep parallelization at a maximum. And thus, there may be some scenarios that may be too lenient.

I would expect SLProtocol to lock the entire table access when doing a set, preventing the second thread from making changes until the first thread is done. However, from your input, it seems like the lock is happening on column or row level for each individual change without locking the overall operation. Your cell update seems to have resolved the necessary row index without staying locked to perform the actual update.

Would have to check the documentation to see what the recommended approach is for QActions, but I would suggest adding locks in your code when writing to tables, or on a per-table basis if a higher throughput is needed.

Edit: I seem to have partially misunderstood your question, here's more information that should answer your questions:

Only one QAction can be executed at a time unless one of these options is used in the connector:

  • https://docs.dataminer.services/develop/schemadoc/Protocol/Protocol.Threads.Thread.html
  • options attribute - queued

Then, within the QAction it is also possible to launch additional threads, which can probably in turn, execute another QAction by setting a parameter.

I believe that your first scenario is using an additional thread within the QAction, so that is a potential clash. Your second scenario doesn't seem to fall into any of these cases, since the update to parameter 1 would be executed on the same protocol thread as the group/action of timer 1.

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 28th August 2023
David Burden commented 25th August 2023

Thankyou Floris, that does answer my questions.
When you refer to adding necessary locking, is it sufficient to just use the standard locking features that come with .NET such as lock{}, Monitor and Semaphores?

Floris Cockaerts [SLC] [DevOps Advocate] commented 25th August 2023

Hi David,

Yes, those will be sufficient. It’s mostly a matter of finding which blocks of code need to be locked without losing the advantage of having multiple threads by locking everything.

Do be mindful of correctly providing an object to lock on to the different QActions. It needs to be the same instance, or one QAction will not prevent another from executing the problematic code.

You are viewing 1 out of 1 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas

Recent questions

Redundancy Groups and Alarming – Duplicate Alarms 0 Answers | 0 Votes
Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 Votes
When using the Setter = true attribute, will the copy action always be executed first? 1 Answer | 3 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (109) Correlation (69) Correlation rule (52) Cube (150) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin