#include <TGo4ThreadManager.h>
Inheritance diagram for TGo4ThreadManager:
Public Methods | |
TGo4ThreadManager (const TGo4ThreadManager &right) | |
TGo4ThreadManager (const char *name, Bool_t blockingmode=kTRUE, Bool_t autostart=kTRUE, Bool_t autocreate=kTRUE) | |
ctor parameters: blockingmode=true: gApplication is blocked by timer autostart=true: all thread runnables start their work on Initialization() autocreate=true: all threads added to handler in threadmanager ctor are created on Launch(). More... | |
virtual | ~TGo4ThreadManager () |
TGo4ThreadManager & | operator= (const TGo4ThreadManager &right) |
void | SetTimer (TGo4AppControlTimer *ctrltimer) |
user can exchange the standard control timer by an own derived one by this method. More... | |
TGo4ThreadHandler * | GetWorkHandler () |
Access to ThreadHandler for working threads. More... | |
Bool_t | BlockApp () |
Blocks gSystem by means of the blocking timer. More... | |
Bool_t | UnBlockApp (Int_t mode=0) |
Wakes up the control timer waiting for his condition; parameter mode specifies whether timer will block again at next turn (mode=0), timer will block when all threads are up (mode=1), or timer will not block again unless the next Block call, i.e. More... | |
virtual Int_t | Initialization () |
Bool_t | IsInitDone () const |
Bool_t | IsTerminating () const |
returns termination status of Threadmanager. More... | |
Bool_t | IsTerminateApp () const |
Bool_t | IsAppBlocking () |
Returns true if threadmanager works in root system blocking mode. More... | |
void | Launch () |
This Method has to be called to create the startup threads and to turn on the application control timer. More... | |
virtual void | Terminate (Bool_t termapp=kTRUE) |
deletes the Manager instance via Control timer. More... | |
virtual void | TerminateFast () |
Alternative termination in case of error. More... | |
Static Public Attributes | |
const Long_t | fglTIMERPERIOD = 200 |
Period in ms for the application control timer. More... | |
const UInt_t | fguTEXTLENGTH = 256 |
Default textlength for char arrays. More... | |
Protected Attributes | |
Bool_t | fbInitDone |
is set kTRUE after first Initialize is done. More... | |
Bool_t | fbTerminating |
flag showing termination status. More... | |
Bool_t | fbTerminateApplication |
If true, terminate complete application. More... | |
Bool_t | fbAppBlocking |
true if threadmanager shall block root gSystem using the AppControlTimer; false if gSystem shall never be blocked (necessary for gui). More... | |
Bool_t | fbAutoCreate |
If true, TThreads of all go4threads in list shall be created automatically on calling Launch(). More... | |
Bool_t | fbAutoStart |
If true, workfunctions (runnable Run()) of all go4threads in list shall be started automatically on Initialization. More... | |
TGo4AppControlTimer * | fxBlocker |
Composition of Application control timer. More... | |
TGo4ThreadHandler * | fxWorkHandler |
Thread handler aggregate (threadsafe list of go4 threads) More... | |
Private Methods | |
TGo4ThreadManager () |
Definition at line 34 of file TGo4ThreadManager.h.
|
Definition at line 27 of file TGo4ThreadManager.cxx. References fxBlocker, fxWorkHandler, and TRACE. |
|
ctor parameters: blockingmode=true: gApplication is blocked by timer autostart=true: all thread runnables start their work on Initialization() autocreate=true: all threads added to handler in threadmanager ctor are created on Launch().
Definition at line 38 of file TGo4ThreadManager.cxx. References TGo4Log::Debug(), fbAppBlocking, fbAutoCreate, fbAutoStart, fglTIMERPERIOD, fguTEXTLENGTH, fxBlocker, fxWorkHandler, TGo4AppControlTimer::SetApplicationRun(), and TRACE. |
|
Definition at line 74 of file TGo4ThreadManager.cxx. References fxWorkHandler, and TRACE. |
|
|
|
Definition at line 83 of file TGo4ThreadManager.cxx. References fbAppBlocking, fbInitDone, fbTerminating, fxBlocker, fxWorkHandler, and TRACE. Referenced by TGo4TestThreadManager::operator=(). |
|
user can exchange the standard control timer by an own derived one by this method.
Definition at line 55 of file TGo4ThreadManager.h. References fxBlocker. |
|
Access to ThreadHandler for working threads.
Definition at line 63 of file TGo4ThreadManager.h. References fxWorkHandler. Referenced by TGo4ServerTask::ConnectorThreadIsStopped(), TGo4Slave::GetThreadHandler(), TGo4AppControlTimer::Notify(), TGo4TestRunnable::Run(), TGo4ServerTask::StartConnectorThread(), TGo4ExampleServer::StartWorkThreads(), TGo4ServerTask::StopConnectorThread(), TGo4ExampleServer::StopWorkThreads(), TGo4Task::TGo4Task(), TGo4TaskHandler::TGo4TaskHandler(), TGo4ThreadException::TGo4ThreadException(), TGo4Display::~TGo4Display(), and TGo4ServerTask::~TGo4ServerTask(). |
|
Blocks gSystem by means of the blocking timer.
Definition at line 103 of file TGo4ThreadManager.cxx. References fbTerminating, fxBlocker, fxWorkHandler, TGo4ThreadHandler::IsOperating(), TGo4AppControlTimer::SetApplicationRun(), and TRACE. Referenced by TGo4ThreadHandler::Cancel(), TGo4ThreadHandler::Create(), TGo4ThreadHandler::CreateAll(), Initialization(), TGo4ThreadHandler::ReCreate(), TGo4ThreadHandler::RemoveThread(), TGo4TestRunnable::Run(), TGo4ThreadHandler::Start(), and TGo4ThreadHandler::StartAll(). |
|
Wakes up the control timer waiting for his condition; parameter mode specifies whether timer will block again at next turn (mode=0), timer will block when all threads are up (mode=1), or timer will not block again unless the next Block call, i.e. applicationrun flag is reset (mode=2) Definition at line 131 of file TGo4ThreadManager.cxx. References fxBlocker, TGo4AppControlTimer::GetApplicationRun(), TGo4AppControlTimer::GetCondition(), TGo4AppControlTimer::SetApplicationRun(), and TRACE. Referenced by TGo4ThreadHandler::Cancel(), TGo4ThreadHandler::Create(), TGo4ThreadHandler::CreateAll(), TGo4ThreadHandler::ReCreate(), TGo4ThreadHandler::RemoveThread(), TGo4TestRunnable::Run(), TGo4ThreadHandler::Start(), TGo4ThreadHandler::StartAll(), and Terminate(). |
|
Reimplemented in TGo4ClientTask, and TGo4Task. Definition at line 179 of file TGo4ThreadManager.cxx. References TGo4ThreadHandler::AllCreated(), BlockApp(), TGo4Log::Debug(), TGo4ThreadHandler::DumpThreads(), fbInitDone, fxWorkHandler, TGo4ThreadHandler::StartAll(), and TRACE. Referenced by TGo4Task::Initialization(), and TGo4AppControlTimer::Notify(). |
|
Definition at line 85 of file TGo4ThreadManager.h. References fbInitDone. |
|
returns termination status of Threadmanager.
Definition at line 93 of file TGo4ThreadManager.h. References fbTerminating. Referenced by TGo4HistogramServer::ConnectObjectClient(), TGo4AppControlTimer::Notify(), TGo4StatusRunnable::Run(), TGo4DataRunnable::Run(), TGo4CommandRunnable::Run(), TGo4TaskManager::ServeClient(), TGo4TaskManager::WaitForClientRemoved(), TGo4ServerTask::WaitForConnection(), TGo4HistogramServer::WaitForConnection(), TGo4HistogramServer::WaitForOpen(), and TGo4TaskHandler::WaitGetPort(). |
|
Definition at line 98 of file TGo4ThreadManager.h. References fbTerminateApplication. Referenced by TGo4AppControlTimer::Notify(). |
|
Returns true if threadmanager works in root system blocking mode.
Definition at line 106 of file TGo4ThreadManager.h. References fbAppBlocking. |
|
This Method has to be called to create the startup threads and to turn on the application control timer. Usually this is done at the end of the user's threadmanager constructor. The idea is that no thread should be started unless the user initializations are done; therefore, its up to the user to define when to Launch. Definition at line 237 of file TGo4ThreadManager.cxx. References TGo4ThreadHandler::CreateAll(), fxBlocker, fxWorkHandler, and TRACE. Referenced by TGo4AnalysisClient::Constructor(), TGo4ClientTask::TGo4ClientTask(), TGo4Display::TGo4Display(), TGo4ExampleClient::TGo4ExampleClient(), TGo4ExampleServer::TGo4ExampleServer(), TGo4ServerTask::TGo4ServerTask(), and TGo4TestThreadManager::TGo4TestThreadManager(). |
|
deletes the Manager instance via Control timer. If termap is true, also terminates the root Application Reimplemented in TGo4Task. Definition at line 254 of file TGo4ThreadManager.cxx. References TGo4Log::Debug(), fbTerminateApplication, fbTerminating, fxWorkHandler, TGo4ThreadHandler::StopAll(), TRACE, and UnBlockApp(). Referenced by TGo4TerminateException::Handle(), TGo4Task::Terminate(), TerminateFast(), and TGo4Runnable::UnexpectedCatch(). |
|
Alternative termination in case of error.
Reimplemented in TGo4Task. Definition at line 268 of file TGo4ThreadManager.cxx. References Terminate(). Referenced by TGo4Task::TerminateFast(). |
|
Period in ms for the application control timer.
Definition at line 23 of file TGo4ThreadManager.cxx. Referenced by TGo4ThreadManager(). |
|
Default textlength for char arrays.
Definition at line 25 of file TGo4ThreadManager.cxx. Referenced by TGo4TaskHandler::ConnectClientChannel(), TGo4TaskHandler::ConnectServerChannel(), TGo4AnalysisClient::Constructor(), TGo4ComStartHistoServ::ExeCom(), TGo4AnalysisClient::ExecuteString(), TGo4ReplaceException::Handle(), TGo4RemoveException::Handle(), TGo4HistogramServer::HandleObjectRequest(), TGo4ServerTask::LaunchClient(), TGo4Master::LaunchSlaveServer(), TGo4MbsHist::ScanGo4Folder(), TGo4TaskManager::ServeClient(), TGo4ClientTask::TGo4ClientTask(), TGo4ExampleClient::TGo4ExampleClient(), TGo4ExampleServer::TGo4ExampleServer(), TGo4ServerTask::TGo4ServerTask(), TGo4Task::TGo4Task(), TGo4TaskHandler::TGo4TaskHandler(), TGo4TestThreadManager::TGo4TestThreadManager(), and TGo4ThreadManager(). |
|
is set kTRUE after first Initialize is done.
Definition at line 148 of file TGo4ThreadManager.h. Referenced by Initialization(), IsInitDone(), operator=(), and TGo4Task::UpdateStatus(). |
|
flag showing termination status.
Definition at line 153 of file TGo4ThreadManager.h. Referenced by BlockApp(), IsTerminating(), operator=(), Terminate(), and TGo4Task::UpdateStatus(). |
|
If true, terminate complete application. If false, only terminate threadmanager instance. Definition at line 159 of file TGo4ThreadManager.h. Referenced by IsTerminateApp(), and Terminate(). |
|
true if threadmanager shall block root gSystem using the AppControlTimer; false if gSystem shall never be blocked (necessary for gui).
Definition at line 166 of file TGo4ThreadManager.h. Referenced by IsAppBlocking(), operator=(), TGo4ThreadManager(), and TGo4Task::UpdateStatus(). |
|
If true, TThreads of all go4threads in list shall be created automatically on calling Launch().
Definition at line 172 of file TGo4ThreadManager.h. Referenced by TGo4ThreadManager(), and TGo4Task::UpdateStatus(). |
|
If true, workfunctions (runnable Run()) of all go4threads in list shall be started automatically on Initialization. If false, TThreads may be running, but workfunctions suspend in condition wait. Definition at line 179 of file TGo4ThreadManager.h. Referenced by TGo4ThreadManager(), and TGo4Task::UpdateStatus(). |
|
Composition of Application control timer.
Definition at line 187 of file TGo4ThreadManager.h. Referenced by BlockApp(), Launch(), operator=(), SetTimer(), TGo4ThreadManager(), and UnBlockApp(). |
|
Thread handler aggregate (threadsafe list of go4 threads)
Definition at line 195 of file TGo4ThreadManager.h. Referenced by BlockApp(), TGo4ClientTask::ConnectServer(), GetWorkHandler(), Initialization(), TGo4Task::Initialization(), Launch(), operator=(), TGo4ExampleClient::Start(), TGo4ExampleClient::Stop(), TGo4Task::SubmitLocalCommand(), Terminate(), TGo4ExampleClient::TGo4ExampleClient(), TGo4ExampleServer::TGo4ExampleServer(), TGo4ServerTask::TGo4ServerTask(), TGo4TestThreadManager::TGo4TestThreadManager(), TGo4ThreadManager(), TGo4ExampleClient::~TGo4ExampleClient(), TGo4ExampleServer::~TGo4ExampleServer(), and ~TGo4ThreadManager(). |