ATLAS Offline Software
AthAsynchronousAlgorithm.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2024 - 2025 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // AthAsynchronousAlgorithm.h
8 // Header file for class AthAsynchronousAlgorithm
9 // Author: Beojan Stanislaus
11 #ifndef ATHENABASECOMPS_ATHASYNCHRONOUSALGORITHM_H
12 #define ATHENABASECOMPS_ATHASYNCHRONOUSALGORITHM_H 1
13 
14 // Framework includes
17 #include "Gaudi/AsynchronousAlgorithm.h"
18 
19 // Other includes
20 #include <boost/fiber/all.hpp>
21 
28  : public AthCommonReentrantAlgorithm<Gaudi::AsynchronousAlgorithm> {
30  Gaudi::AsynchronousAlgorithm>::AthCommonReentrantAlgorithm;
31 
32  public:
33  StatusCode sysExecute(const EventContext& ctx) override;
34 
36  virtual StatusCode restoreAfterSuspend() const override;
37 
38  protected:
39  // This is local to each fiber so it can't be accessed from multiple threads
40  // at once
42  mutable boost::fibers::fiber_specific_ptr<EventContext> m_currentCtx
44 };
45 
46 #endif //> !ATHENABASECOMPS_ATHASYNCHRONOUSALGORITHM_H
AthAsynchronousAlgorithm::restoreAfterSuspend
virtual StatusCode restoreAfterSuspend() const override
Restore after suspend.
Definition: AthAsynchronousAlgorithm.cxx:30
AthAsynchronousAlgorithm::ATLAS_THREAD_SAFE
boost::fibers::fiber_specific_ptr< EventContext > m_currentCtx ATLAS_THREAD_SAFE
Pointer to current context.
Definition: AthAsynchronousAlgorithm.h:43
AthAsynchronousAlgorithm
An algorithm that can be suspended while work is offloaded to an accelerator.
Definition: AthAsynchronousAlgorithm.h:28
AthAsynchronousAlgorithm::sysExecute
StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthAsynchronousAlgorithm.cxx:11
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthCommonReentrantAlgorithm< Gaudi::AsynchronousAlgorithm >::AthCommonReentrantAlgorithm
AthCommonReentrantAlgorithm()
Default constructor:
AthCommonReentrantAlgorithm.h
AthCommonReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthCommonReentrantAlgorithm.h:40
checker_macros.h
Define macros for attributes used to control the static checker.