Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  01 Jun 2026, Yiwen Yang, Suggestion, Multithreaded deferred transitions 
    Reply  11 Jun 2026, Stefan Ritt, Suggestion, Multithreaded deferred transitions 
       Reply  25 Jun 2026, Konstantin Olchanski, Suggestion, Multithreaded deferred transitions 
          Reply  25 Jun 2026, Yiwen Yang, Suggestion, Multithreaded deferred transitions 
Message ID: 3231     Entry time: 01 Jun 2026     Reply to this: 3233
Author: Yiwen Yang 
Topic: Suggestion 
Subject: Multithreaded deferred transitions 
Hi,

On the DAQ system for T2K's ND280 near detector, we use deferred
transitions to make sure all triggered events were logged before issuing run
stops to frontends.

I've recently managed to update the frontends to use a
relatively modern version of MIDAS. I then noticed that run transitions are now
by default multithreaded, when issued from e.g. mhttpd, but deferred transitions
called by cm_check_deferred_transition are still performed synchronously.

It
would be nice to make run stops use multithreaded transitions as well. A naive
patch of adding the TR_MTHREAD flag does not work, since the client handling the
deferred transition attempts to communicate with itself instead of calling
cm_transition_call_direct.

After looking into the code a bit further, I noticed
that there is an intentional check against multithreaded transitions in the
logic for determining whether the client is the one calling the transition:

https://bitbucket.org/tmidas/midas/src/fd71f63c023b7e2d4a5c91e3121651b14bd9d27b/
src/midas.cxx#lines-5009

Was there a particular concern that lead to this
particular check?


Regards,
Yiwen.
ELOG V3.1.6-083448f7