![]() |
GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
|
![]() |
Base-class for all loops/threads.
Definition at line 28 of file StoppableThread.h.
Public Member Functions | |
| StoppableThread (const StoppableThread &)=delete | |
| StoppableThread (std::string name) | |
| StoppableThread (StoppableThread &&) noexcept=delete | |
| virtual | ~StoppableThread () |
| virtual void | ClearQueue () |
| virtual std::string | EndStatus () |
| virtual size_t | GetItemsCurrent ()=0 |
| virtual size_t | GetItemsPopped ()=0 |
| virtual size_t | GetItemsPushed ()=0 |
| virtual size_t | GetRate ()=0 |
| bool | IsPaused () |
| bool | IsRunning () |
| virtual bool | Iteration ()=0 |
| void | Join () |
| std::string | Name () const |
| virtual void | OnEnd () |
| StoppableThread & | operator= (const StoppableThread &)=delete |
| StoppableThread & | operator= (StoppableThread &&) noexcept=delete |
| void | Pause () |
| virtual std::string | Progress () |
| void | Resume () |
| virtual std::string | Status () |
| void | Stop () |
Static Public Member Functions | |
| static std::string | AllThreadHeader () |
| static std::string | AllThreadProgress () |
| static std::string | AllThreadStatus () |
| static bool | AnyThreadRunning () |
| static std::string | AnyThreadStatus () |
| static void | ClearAllQueues () |
| static size_t | ColumnWidth () |
| static void | ColumnWidth (size_t val) |
| static StoppableThread * | Get (const std::string &name) |
| static std::vector< StoppableThread * > | GetAll () |
| static int | GetNThreads () |
| static void | join_status_thread () |
| static void | PauseAll () |
| static void | Print () |
| static void | ResumeAll () |
| static void | SendStop () |
| static void | start_status_thread () |
| static void | status_out () |
| static void | status_out_loop () |
| static size_t | StatusWidth () |
| static void | StatusWidth (size_t val) |
| static void | stop_status_thread () |
| static void | StopAll () |
Protected Member Functions | |
| void | IncrementItemsPopped () |
| std::atomic_long & | InputSize () |
| void | InputSize (int64_t val) |
| std::atomic_size_t & | ItemsPopped () |
| void | ItemsPopped (size_t val) |
Private Member Functions | |
| void | Loop () |
Private Attributes | |
| std::atomic_bool | fForceStop {false} |
| std::atomic_long | fInputSize {0} |
| std::atomic_size_t | fItemsPopped {0} |
| std::string | fName |
| std::atomic_bool | fPaused {false} |
| std::condition_variable | fPausedWait |
| std::mutex | fPauseMutex |
| std::atomic_bool | fRunning {false} |
| std::thread | fThread |
Static Private Attributes | |
| static size_t | fColumnWidth = 20 |
| static std::thread | fStatusThread |
| static bool | fStatusThreadOn = false |
| static size_t | fStatusWidth = 80 |
| static std::map< std::string, StoppableThread * > | fThreadMap |
Inheritance diagram for StoppableThread:
Collaboration diagram for StoppableThread:
|
explicit |
Definition at line 26 of file StoppableThread.cxx.
References fName, fStatusThreadOn, fThread, fThreadMap, Loop(), and start_status_thread().
|
delete |
|
deletenoexcept |
|
virtual |
Definition at line 182 of file StoppableThread.cxx.
References fName, fStatusThread, fStatusThreadOn, and fThreadMap.
|
static |
Definition at line 73 of file StoppableThread.cxx.
References fColumnWidth, fStatusWidth, and fThreadMap.
Referenced by TGRSIint::ApplyOptions().
|
static |
Definition at line 59 of file StoppableThread.cxx.
References fColumnWidth, fStatusWidth, and fThreadMap.
Referenced by TGRSIint::LoopUntilDone().
|
static |
Definition at line 83 of file StoppableThread.cxx.
References fColumnWidth, fStatusWidth, and fThreadMap.
Referenced by TGRSIint::LoopUntilDone().
|
static |
Definition at line 37 of file StoppableThread.cxx.
References fThreadMap.
Referenced by TChannel::GetChannel(), TGRSIint::LoopUntilDone(), and TGRSIInterruptHandler::Notify().
|
static |
Definition at line 47 of file StoppableThread.cxx.
References fThreadMap.
|
static |
Definition at line 166 of file StoppableThread.cxx.
References fThreadMap.
Referenced by TGRSIInterruptHandler::Notify().
|
inlinevirtual |
Reimplemented in TAnalysisHistLoop, TAnalysisWriteLoop, TDataLoop, TDetBuildingLoop, TEventBuildingLoop, TFragDiagnosticsLoop, TFragHistLoop, TFragmentChainLoop, TFragWriteLoop, TTerminalLoop< T >, and TUnpackingLoop.
Definition at line 64 of file StoppableThread.h.
|
inlinestatic |
Definition at line 81 of file StoppableThread.h.
References fColumnWidth.
Referenced by TGRSIint::SetupPipeline().
|
inlinestatic |
Definition at line 79 of file StoppableThread.h.
References fColumnWidth.
|
inlinevirtual |
Reimplemented in TAnalysisWriteLoop, TEventBuildingLoop, TFragDiagnosticsLoop, TFragWriteLoop, and TUnpackingLoop.
Definition at line 61 of file StoppableThread.h.
|
static |
Definition at line 173 of file StoppableThread.cxx.
References fThreadMap.
Referenced by TAnalysisHistLoop::Get(), TAnalysisWriteLoop::Get(), TDataLoop::Get(), TDetBuildingLoop::Get(), TEventBuildingLoop::Get(), TFragDiagnosticsLoop::Get(), TFragHistLoop::Get(), TFragmentChainLoop::Get(), TFragWriteLoop::Get(), TTerminalLoop< T >::Get(), and TUnpackingLoop::Get().
|
static |
Definition at line 315 of file StoppableThread.cxx.
References fThreadMap.
|
pure virtual |
Implemented in TAnalysisHistLoop, TAnalysisWriteLoop, TDataLoop, TDetBuildingLoop, TEventBuildingLoop, TFragDiagnosticsLoop, TFragHistLoop, TFragmentChainLoop, TFragWriteLoop, TTerminalLoop< T >, and TUnpackingLoop.
Referenced by status_out().
|
pure virtual |
Implemented in TAnalysisHistLoop, TAnalysisWriteLoop, TDataLoop, TDetBuildingLoop, TEventBuildingLoop, TFragDiagnosticsLoop, TFragHistLoop, TFragmentChainLoop, TFragWriteLoop, TTerminalLoop< T >, and TUnpackingLoop.
Referenced by status_out().
|
pure virtual |
Implemented in TAnalysisHistLoop, TAnalysisWriteLoop, TDataLoop, TDetBuildingLoop, TEventBuildingLoop, TFragDiagnosticsLoop, TFragHistLoop, TFragmentChainLoop, TFragWriteLoop, TTerminalLoop< T >, and TUnpackingLoop.
Referenced by status_out().
|
static |
|
pure virtual |
Implemented in TAnalysisHistLoop, TAnalysisWriteLoop, TDataLoop, TDetBuildingLoop, TEventBuildingLoop, TFragDiagnosticsLoop, TFragHistLoop, TFragmentChainLoop, TFragWriteLoop, TTerminalLoop< T >, and TUnpackingLoop.
Referenced by status_out().
|
inlineprotected |
Definition at line 96 of file StoppableThread.h.
References fItemsPopped.
Referenced by TAnalysisHistLoop::Iteration(), TAnalysisWriteLoop::Iteration(), TDetBuildingLoop::Iteration(), TEventBuildingLoop::Iteration(), TFragDiagnosticsLoop::Iteration(), TFragHistLoop::Iteration(), TFragmentChainLoop::Iteration(), TFragWriteLoop::Iteration(), and TUnpackingLoop::Iteration().
|
inlineprotected |
Definition at line 95 of file StoppableThread.h.
References fInputSize.
Referenced by TAnalysisWriteLoop::EndStatus(), TFragDiagnosticsLoop::EndStatus(), TFragWriteLoop::EndStatus(), TAnalysisHistLoop::Iteration(), TAnalysisWriteLoop::Iteration(), TDataLoop::Iteration(), TDetBuildingLoop::Iteration(), TEventBuildingLoop::Iteration(), TFragDiagnosticsLoop::Iteration(), TFragHistLoop::Iteration(), TFragmentChainLoop::Iteration(), TFragWriteLoop::Iteration(), and TUnpackingLoop::Iteration().
|
inlineprotected |
Definition at line 93 of file StoppableThread.h.
References fInputSize.
| bool StoppableThread::IsPaused | ( | ) |
Definition at line 224 of file StoppableThread.cxx.
References fPaused.
| bool StoppableThread::IsRunning | ( | ) |
Definition at line 219 of file StoppableThread.cxx.
References fRunning.
Referenced by status_out().
|
inlineprotected |
Definition at line 94 of file StoppableThread.h.
References fItemsPopped.
Referenced by TAnalysisWriteLoop::EndStatus(), TEventBuildingLoop::EndStatus(), TFragDiagnosticsLoop::EndStatus(), TFragWriteLoop::EndStatus(), TFragDiagnosticsLoop::GetItemsPopped(), TFragmentChainLoop::GetItemsPopped(), TFragWriteLoop::GetItemsPopped(), TAnalysisWriteLoop::GetItemsPushed(), TFragDiagnosticsLoop::GetItemsPushed(), TFragmentChainLoop::GetItemsPushed(), TFragWriteLoop::GetItemsPushed(), TDataLoop::Iteration(), TFragmentChainLoop::Iteration(), TUnpackingLoop::Iteration(), and TFragmentChainLoop::Restart().
|
inlineprotected |
Definition at line 92 of file StoppableThread.h.
References fItemsPopped.
|
pure virtual |
Implemented in TAnalysisHistLoop, TAnalysisWriteLoop, TDataLoop, TDetBuildingLoop, TEventBuildingLoop, TFragDiagnosticsLoop, TFragHistLoop, TFragmentChainLoop, TFragWriteLoop, TTerminalLoop< T >, and TUnpackingLoop.
Referenced by Loop().
| void StoppableThread::Join | ( | ) |
Definition at line 229 of file StoppableThread.cxx.
References EndStatus(), and fThread.
Referenced by StopAll().
|
static |
Definition at line 280 of file StoppableThread.cxx.
References fStatusThread, and stop_status_thread().
|
private |
Definition at line 237 of file StoppableThread.cxx.
References fPaused, fPausedWait, fPauseMutex, fRunning, Iteration(), and OnEnd().
Referenced by StoppableThread().
|
inline |
Definition at line 62 of file StoppableThread.h.
References fName.
Referenced by TAnalysisWriteLoop::AddBranch(), TFragDiagnosticsLoop::CreateHistograms(), TAnalysisWriteLoop::EndStatus(), TFragDiagnosticsLoop::EndStatus(), TFragWriteLoop::EndStatus(), TUnpackingLoop::EndStatus(), TFragDiagnosticsLoop::Process(), status_out(), and TFragDiagnosticsLoop::Write().
|
inlinevirtual |
Reimplemented in TAnalysisWriteLoop, TDataLoop, and TFragmentChainLoop.
Definition at line 58 of file StoppableThread.h.
Referenced by Loop().
|
delete |
|
deletenoexcept |
| void StoppableThread::Pause | ( | ) |
Definition at line 202 of file StoppableThread.cxx.
|
static |
Definition at line 97 of file StoppableThread.cxx.
References fThreadMap.
|
static |
Definition at line 254 of file StoppableThread.cxx.
References fColumnWidth, fStatusWidth, fThreadMap, GetNThreads(), and hex().
|
virtual |
Definition at line 119 of file StoppableThread.cxx.
References fColumnWidth, fInputSize, and fItemsPopped.
| void StoppableThread::Resume | ( | ) |
Definition at line 193 of file StoppableThread.cxx.
References fPaused, fPausedWait, fPauseMutex, and fRunning.
|
static |
Definition at line 104 of file StoppableThread.cxx.
References fThreadMap.
Referenced by TGRSIint::SetupPipeline().
|
static |
Definition at line 135 of file StoppableThread.cxx.
References fThreadMap.
Referenced by StopAll(), and TGRSIint::Terminate().
|
static |
Definition at line 265 of file StoppableThread.cxx.
References fStatusThread, fStatusThreadOn, and status_out_loop().
Referenced by StoppableThread().
|
virtual |
Definition at line 111 of file StoppableThread.cxx.
References fColumnWidth, fInputSize, and fItemsPopped.
|
static |
Definition at line 297 of file StoppableThread.cxx.
References fThreadMap, GetItemsCurrent(), GetItemsPopped(), GetItemsPushed(), GetRate(), IsRunning(), and Name().
Referenced by status_out_loop(), and StopAll().
|
static |
Definition at line 286 of file StoppableThread.cxx.
References fStatusThreadOn, and status_out().
Referenced by start_status_thread().
|
inlinestatic |
Definition at line 82 of file StoppableThread.h.
References fStatusWidth.
Referenced by TGRSIint::SetupPipeline().
|
inlinestatic |
Definition at line 80 of file StoppableThread.h.
References fStatusWidth.
| void StoppableThread::Stop | ( | ) |
Definition at line 209 of file StoppableThread.cxx.
References EndStatus(), fPaused, fPausedWait, fPauseMutex, and fRunning.
|
static |
Definition at line 273 of file StoppableThread.cxx.
References fStatusThreadOn.
Referenced by join_status_thread().
|
static |
Definition at line 147 of file StoppableThread.cxx.
References fThreadMap, Join(), SendStop(), and status_out().
Referenced by TGRSIint::Terminate().
|
staticprivate |
Definition at line 107 of file StoppableThread.h.
Referenced by AllThreadHeader(), AllThreadProgress(), AllThreadStatus(), ColumnWidth(), ColumnWidth(), Print(), Progress(), and Status().
|
private |
Definition at line 119 of file StoppableThread.h.
|
private |
number of items in the input (queue), only updated within Iteration(), so not always fully up-to-date (signed to hold error from queue::pop)
Definition at line 101 of file StoppableThread.h.
Referenced by InputSize(), InputSize(), Progress(), and Status().
|
private |
number of items popped from input queue
Definition at line 100 of file StoppableThread.h.
Referenced by IncrementItemsPopped(), ItemsPopped(), ItemsPopped(), Progress(), and Status().
|
private |
Definition at line 105 of file StoppableThread.h.
Referenced by StoppableThread(), ~StoppableThread(), and Name().
|
private |
Definition at line 120 of file StoppableThread.h.
Referenced by IsPaused(), Loop(), Pause(), Resume(), and Stop().
|
private |
Definition at line 121 of file StoppableThread.h.
|
private |
Definition at line 122 of file StoppableThread.h.
|
private |
Definition at line 118 of file StoppableThread.h.
Referenced by IsRunning(), Loop(), Pause(), Resume(), and Stop().
|
staticprivate |
Definition at line 116 of file StoppableThread.h.
Referenced by ~StoppableThread(), join_status_thread(), and start_status_thread().
|
staticprivate |
Definition at line 114 of file StoppableThread.h.
Referenced by StoppableThread(), ~StoppableThread(), start_status_thread(), status_out_loop(), and stop_status_thread().
|
staticprivate |
Definition at line 108 of file StoppableThread.h.
Referenced by AllThreadHeader(), AllThreadProgress(), AllThreadStatus(), Print(), StatusWidth(), and StatusWidth().
|
private |
Definition at line 117 of file StoppableThread.h.
Referenced by StoppableThread(), and Join().
|
staticprivate |
Definition at line 112 of file StoppableThread.h.
Referenced by StoppableThread(), ~StoppableThread(), AllThreadHeader(), AllThreadProgress(), AllThreadStatus(), AnyThreadRunning(), AnyThreadStatus(), ClearAllQueues(), Get(), GetAll(), GetNThreads(), PauseAll(), Print(), ResumeAll(), SendStop(), status_out(), and StopAll().