libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
scheduler_priorities.cpp File Reference
#include "../core/application.hpp"
#include <boost/exception/diagnostic_information.hpp>
#include <boost/program_options.hpp>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <sys/time.h>
#include <sys/resource.h>
Include dependency graph for scheduler_priorities.cpp:

Go to the source code of this file.

Classes

struct  header_guard_t
 

Functions

auto get_sched_min_max () noexcept(false)
 
int main (int argc, char const *const *argv) noexcept(true)
 Discover the minimum and maximum scheduler-priorities on the current system. More...
 

Variables

constexpr const char copyright []
 
constexpr const char header_guard_postfix [] ="#endif\n"
 
const int schedule_policy =SCHED_OTHER
 

Function Documentation

◆ get_sched_min_max()

auto get_sched_min_max ( )
noexcept

Definition at line 90 of file scheduler_priorities.cpp.

References schedule_policy.

◆ main()

Variable Documentation

◆ copyright

constexpr const char copyright[]
constexpr
Initial value:
=
"/******************************************************************************\n"
"** Copyright © 2019 by J.M.McGuiness, coder@hussar.me.uk\n"
"**\n"
"** This library is free software; you can redistribute it and/or\n"
"** modify it under the terms of the GNU Lesser General Public\n"
"** License as published by the Free Software Foundation; either\n"
"** version 2.1 of the License, or (at your option) any later version.\n"
"**\n"
"** This library is distributed in the hope that it will be useful,\n"
"** but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
"** Lesser General Public License for more details.\n"
"**\n"
"** You should have received a copy of the GNU Lesser General Public\n"
"** License along with this library; if not, write to the Free Software\n"
"** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"
"*/\n"

Definition at line 31 of file scheduler_priorities.cpp.

◆ header_guard_postfix

constexpr const char header_guard_postfix[] ="#endif\n"
constexpr

Definition at line 49 of file scheduler_priorities.cpp.

Referenced by header_guard_t::~header_guard_t().

◆ schedule_policy

const int schedule_policy =SCHED_OTHER
Todo:
This cannot be set unless CAP_SYS_RESOURCE is applied.

const int schedule_policy=SCHED_FIFO;

This may be done thus:

sudo setcap 'CAP_SYS_RESOURCE=+ep' /path/to/executable

If SCHED_OTHER is used then basically one cannot set the priority, as the min & max are both set to zero.

Todo:
This cannot be set unless CAP_SYS_RESOURCE is applied.

const int schedule_policy=SCHED_FIFO;

This may be done thus:

sudo setcap 'CAP_SYS_RESOURCE=+ep' /path/to/executable

If SCHED_OTHER is used then basically one cannot set the priority, as the min & max are both set to zero.

Definition at line 62 of file scheduler_priorities.cpp.

Referenced by get_sched_min_max().