Hello all,
This is a very interesting topic. I have an example and would be nice to get some guidance on how to proceed.
Let’s say there are two IOCs running in the same host (which has Linux PREEMPT_RT, btw). The IOC A has a record that gets updated at 10 Hz (via hardware interrupts). The IOC B has a
record that gets updated and fetches its timestamp using the TSEL link (with CPP) mechanism from that 10Hz PV of the IOC A.
Which are the threads (in both IOCs) that I should elevate priority or run in dedicated cores that will improve the determinism of this operation? (not interested in reducing the latency,
but to know that this latency won’t be more than N micro/milliseconds).
Thanks in advance (and sorry for deviate from your original question, Dave!)
João Paulo Martins
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Ralph Lange via Tech-talk <tech-talk at aps.anl.gov>
Reply to: Ralph Lange <ralph.lange at gmx.de>
Date: Friday, 17 May 2024 at 10:46
To: EPICS Tech Talk <tech-talk at aps.anl.gov>
Subject: Re: EPICS and EPICS+PVXS internal threading of IOCs
That is more or less the basic setup.
Note that there are already network specific threads in this list, which are generated per network interface configured.
When EPICS network connections are active, the server(s) on the IOC will usually start one pair of threads per client.
If your IOC uses the parallel callback threads functionality (to utilize parallel processing on multiple CPUs), there will be (highly configurable) more instances of the cbLow/cbMedium/cbHigh threads.
Many drivers and device support modules start their own threads. ASYN ports often have a thread associated with each port, AreaDetector plugins (as they are implemented as ASYN ports) most often start a thread per plugin.
MCoreUtils is a module that you can use to have more control over priorities, scheduling mechanisms and CPU allocation of IOC threads. This is convenient when you're running real-time applications on the same host and want to keep the IOC
from running on your dedicated real-time core(s). (Except maybe for that one device support thread that does the communication between the IOC and the real-time parts...)