12#ifndef ROOT_XrdProofdPriorityMgr
13#define ROOT_XrdProofdPriorityMgr
28#include "XrdOuc/XrdOucHash.hh"
29#include "XrdOuc/XrdOucString.hh"
39#define XPPM_NOPRIORITY 999999
81 char *val, XrdOucStream *cfg,
bool rcf);
85 int AddSession(
const char *u,
const char *
g,
int pid);
#define XrdSysMutexHelper
void RegisterDirectives()
Register directives for configuration.
int SetProcessPriority(int pid, const char *usr, int &dp)
Change priority of process pid belonging to user, if needed.
int SetNiceValues(int opt=0)
Recalculate nice values taking into account all active users and their priorities.
XrdProofdPriorityMgr(XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e)
Constructor.
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
virtual ~XrdProofdPriorityMgr()
int DoDirective(XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
Update the priorities of the active sessions.
int AddSession(const char *u, const char *g, int pid)
Add to the active list a session with ID pid.
XrdOucHash< XrdProofdSessionEntry > fSessions
void SetGroupPriority(const char *grp, int priority)
Change group priority. Used when a master pushes a priority to a worker.
int DoDirectiveSchedOpt(char *, XrdOucStream *, bool)
Process 'schedopt' directive.
XrdOucHash< XrdProofdPriority > fPriorities
int DoDirectivePriority(char *, XrdOucStream *, bool)
Process 'priority' directive.
void SetSchedOpt(int opt)
int RemoveSession(int pid)
Remove from the active list the session with ID pid.
virtual ~XrdProofdSessionEntry()
Destructor.
XrdProofdSessionEntry(const char *u, const char *g, int pid)
Constructor.
int SetPriority(int priority=XPPM_NOPRIORITY)
Change process priority.
static constexpr double pi