xrootd
|
#include <XrdScheduler.hh>
Public Member Functions | |
int | Active () |
void | Cancel (XrdJob *jp) |
int | canStick () |
void | DoIt () |
pid_t | Fork (const char *id) |
void * | Reaper () |
void | Run () |
void | Schedule (XrdJob *jp) |
void | Schedule (int num, XrdJob *jfirst, XrdJob *jlast) |
void | Schedule (XrdJob *jp, time_t atime) |
void | setParms (int minw, int maxw, int avlt, int maxi, int once=0) |
void | Start () |
int | Stats (char *buff, int blen, int do_sync=0) |
void | TimeSched () |
XrdScheduler (int minw=8, int maxw=2048, int maxi=780) | |
~XrdScheduler () | |
Public Attributes | |
int | num_TCreate |
int | num_TDestroy |
int | num_Jobs |
int | max_QLength |
int | num_Limited |
Private Member Functions | |
void | hireWorker (int dotrace=1) |
void | Monitor () |
void | traceExit (pid_t pid, int status) |
Private Attributes | |
XrdSysMutex | DispatchMutex |
int | idl_Workers |
int | min_Workers |
int | max_Workers |
int | max_Workidl |
int | num_Workers |
int | stk_Workers |
int | num_JobsinQ |
int | num_Layoffs |
XrdJob * | WorkFirst |
XrdJob * | WorkLast |
XrdSysSemaphore | WorkAvail |
XrdSysMutex | SchedMutex |
XrdJob * | TimerQueue |
XrdSysCondVar | TimerRings |
XrdSysMutex | TimerMutex |
XrdSchedulerPID * | firstPID |
XrdSysMutex | ReaperMutex |
Static Private Attributes | |
static const char * | TraceID = "Sched" |
XrdScheduler::XrdScheduler | ( | int | minw = 8 , |
int | maxw = 2048 , |
||
int | maxi = 780 |
||
) |
References firstPID, idl_Workers, max_QLength, max_Workers, max_Workidl, min_Workers, num_Jobs, num_JobsinQ, num_Limited, num_TCreate, num_TDestroy, num_Workers, stk_Workers, TimerQueue, WorkFirst, and WorkLast.
XrdScheduler::~XrdScheduler | ( | ) |
int XrdScheduler::Active | ( | ) | [inline] |
References idl_Workers, num_JobsinQ, and num_Workers.
Referenced by XrdStats::Report().
void XrdScheduler::Cancel | ( | XrdJob * | jp | ) |
References XrdJob::Comment, XrdSysMutex::Lock(), XrdJob::NextJob, TimerMutex, TimerQueue, TRACE, and XrdSysMutex::UnLock().
Referenced by Schedule(), setParms(), and XrdXrootdJob::~XrdXrootdJob().
int XrdScheduler::canStick | ( | ) | [inline] |
References idl_Workers, num_Workers, and stk_Workers.
Referenced by XrdLink::DoIt().
void XrdScheduler::DoIt | ( | ) | [virtual] |
Implements XrdJob.
References DispatchMutex, idl_Workers, XrdSysMutex::Lock(), max_Workidl, min_Workers, num_JobsinQ, num_Layoffs, num_Workers, XrdSysSemaphore::Post(), SchedMutex, Schedule(), TRACE, XrdSysMutex::UnLock(), and WorkAvail.
pid_t XrdScheduler::Fork | ( | const char * | id | ) |
References XrdSysError::Emsg(), firstPID, fork(), XrdSysMutex::Lock(), ReaperMutex, XrdSysThread::Run(), XrdSysMutex::UnLock(), and XrdStartReaper().
Referenced by XrdRootdProtocol::Match().
void XrdScheduler::hireWorker | ( | int | dotrace = 1 | ) | [private] |
void XrdScheduler::Monitor | ( | ) | [private] |
void * XrdScheduler::Reaper | ( | ) |
References firstPID, XrdSysMutex::Lock(), XrdSchedulerPID::next, XrdSchedulerPID::pid, ReaperMutex, TRACE_SCHED, traceExit(), TRACING, and XrdSysMutex::UnLock().
Referenced by XrdStartReaper().
void XrdScheduler::Run | ( | ) |
References XrdJob::Comment, DispatchMutex, XrdJob::DoIt(), XrdSysError::Emsg(), hireWorker(), idl_Workers, XrdSysMutex::Lock(), XrdJob::NextJob, num_JobsinQ, num_Layoffs, num_TDestroy, num_Workers, SchedMutex, TRACE, XrdSysMutex::UnLock(), XrdSysSemaphore::Wait(), WorkAvail, WorkFirst, and WorkLast.
Referenced by hireWorker(), and XrdStartWorking().
void XrdScheduler::Schedule | ( | XrdJob * | jp | ) |
References XrdSysMutex::Lock(), max_QLength, XrdJob::NextJob, num_Jobs, num_JobsinQ, XrdSysSemaphore::Post(), SchedMutex, XrdSysMutex::UnLock(), WorkAvail, WorkFirst, and WorkLast.
Referenced by XrdXrootdJob::CleanUp(), XrdCmsConfig::Configure2(), XrdPollPoll::Disable(), XrdPollE::Disable(), XrdPollDev::Disable(), XrdCmsProtocol::Dispatch(), XrdXrootdProtocol::do_Offload(), XrdCmsNode::do_SelPrep(), XrdXrootdPrepare::DoIt(), XrdXrootdMonitor_Tick::DoIt(), XrdXrootdJob::DoIt(), XrdStatsJob::DoIt(), DoIt(), XrdObjectQ< T >::DoIt(), XrdLogWorker::DoIt(), XrdCmsPrepare::DoIt(), XrdCmsJob::DoIt(), XrdCmsConfig::DoIt(), XrdXrootdCallBack::Done(), XrdXrootdAio::doneRead(), XrdXrootdAio::doneWrite(), XrdCmsCluster::Drop(), XrdLinkScan::idleScan(), mainAccept(), mainAdmin(), XrdXrootdJob2Do::Redrive(), XrdCmsPrepare::Reset(), XrdPollPoll::Restart(), XrdXrootdJob::Schedule(), XrdObjectQ< T >::Set(), setParms(), XrdLink::Setup(), Start(), XrdPollPoll::Start(), XrdPollE::Start(), XrdPollDev::Start(), XrdXrootdMonitor::startClock(), XrdCmsCache::TickTock(), TimeSched(), XrdCmsDrop::XrdCmsDrop(), XrdLogWorker::XrdLogWorker(), XrdStatsJob::XrdStatsJob(), XrdXrootdJob::XrdXrootdJob(), and XrdXrootdPrepare::XrdXrootdPrepare().
References XrdSysMutex::Lock(), max_QLength, XrdJob::NextJob, num_Jobs, num_JobsinQ, XrdSysSemaphore::Post(), SchedMutex, XrdSysMutex::UnLock(), WorkAvail, WorkFirst, and WorkLast.
void XrdScheduler::Schedule | ( | XrdJob * | jp, |
time_t | atime | ||
) |
void XrdScheduler::setParms | ( | int | minw, |
int | maxw, | ||
int | avlt, | ||
int | maxi, | ||
int | once = 0 |
||
) |
References Cancel(), XrdSysMutex::Lock(), max_Workers, max_Workidl, min_Workers, SchedMutex, Schedule(), stk_Workers, TRACE, and XrdSysMutex::UnLock().
Referenced by XrdConfig::xsched().
void XrdScheduler::Start | ( | ) |
References XrdSysError::Emsg(), hireWorker(), max_Workidl, min_Workers, num_Workers, XrdSysThread::Run(), Schedule(), TRACE, XrdStartTSched(), and XRDSYSTHREAD_BIND.
Referenced by XrdConfig::Setup().
int XrdScheduler::Stats | ( | char * | buff, |
int | blen, | ||
int | do_sync = 0 |
||
) |
References DispatchMutex, idl_Workers, XrdSysMutex::Lock(), max_QLength, num_Jobs, num_JobsinQ, num_Limited, num_TCreate, num_TDestroy, num_Workers, SchedMutex, snprintf, and XrdSysMutex::UnLock().
Referenced by XrdStats::Stats().
void XrdScheduler::TimeSched | ( | ) |
References XrdSysMutex::Lock(), XrdJob::NextJob, XrdJob::SchedTime, Schedule(), TimerMutex, TimerQueue, TimerRings, XrdSysMutex::UnLock(), and XrdSysCondVar::Wait().
Referenced by XrdStartTSched().
void XrdScheduler::traceExit | ( | pid_t | pid, |
int | status | ||
) | [private] |
References TRACE, WEXITSTATUS, WIFEXITED, WIFSIGNALED, and WTERMSIG.
Referenced by Reaper().
XrdSysMutex XrdScheduler::DispatchMutex [private] |
XrdSchedulerPID* XrdScheduler::firstPID [private] |
Referenced by Fork(), Reaper(), and XrdScheduler().
int XrdScheduler::idl_Workers [private] |
Referenced by Active(), canStick(), DoIt(), Run(), Stats(), and XrdScheduler().
Referenced by Schedule(), Stats(), and XrdScheduler().
int XrdScheduler::max_Workers [private] |
Referenced by hireWorker(), setParms(), and XrdScheduler().
int XrdScheduler::max_Workidl [private] |
Referenced by DoIt(), setParms(), Start(), and XrdScheduler().
int XrdScheduler::min_Workers [private] |
Referenced by DoIt(), hireWorker(), setParms(), Start(), and XrdScheduler().
Referenced by Schedule(), Stats(), and XrdScheduler().
int XrdScheduler::num_JobsinQ [private] |
Referenced by Active(), DoIt(), Run(), Schedule(), Stats(), and XrdScheduler().
int XrdScheduler::num_Layoffs [private] |
Referenced by hireWorker(), Stats(), and XrdScheduler().
Referenced by hireWorker(), Stats(), and XrdScheduler().
Referenced by Run(), Stats(), and XrdScheduler().
int XrdScheduler::num_Workers [private] |
Referenced by Active(), canStick(), DoIt(), hireWorker(), Run(), Start(), Stats(), and XrdScheduler().
XrdSysMutex XrdScheduler::ReaperMutex [private] |
XrdSysMutex XrdScheduler::SchedMutex [private] |
Referenced by DoIt(), hireWorker(), Run(), Schedule(), setParms(), and Stats().
int XrdScheduler::stk_Workers [private] |
Referenced by canStick(), hireWorker(), setParms(), and XrdScheduler().
XrdSysMutex XrdScheduler::TimerMutex [private] |
Referenced by Cancel(), Schedule(), and TimeSched().
XrdJob* XrdScheduler::TimerQueue [private] |
Referenced by Cancel(), Schedule(), TimeSched(), and XrdScheduler().
XrdSysCondVar XrdScheduler::TimerRings [private] |
Referenced by Schedule(), and TimeSched().
const char * XrdScheduler::TraceID = "Sched" [static, private] |
XrdSysSemaphore XrdScheduler::WorkAvail [private] |
Referenced by DoIt(), Run(), and Schedule().
XrdJob* XrdScheduler::WorkFirst [private] |
Referenced by Run(), Schedule(), and XrdScheduler().
XrdJob* XrdScheduler::WorkLast [private] |
Referenced by Run(), Schedule(), and XrdScheduler().