1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-16 00:00:02 +01:00
VILLASnode/common/include/villas/kernel/rt.hpp
Steffen Vogel 7d10544d79 Apply clang-format changes
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2024-02-29 18:58:07 +01:00

34 lines
861 B
C++

/* Linux specific real-time optimizations.
*
* @see: https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/application_base
* Author: Steffen Vogel <post@steffenvogel.de>
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <pthread.h>
namespace villas {
namespace kernel {
namespace rt {
void init(int priority, int affinity);
void setProcessAffinity(int affinity);
void setThreadAffinity(pthread_t thread, int affinity);
void setPriority(int priority);
// Checks for realtime (PREEMPT_RT) patched kernel.
//
// See https://rt.wiki.kernel.org
//
// @retval true Kernel is patched.
// @retval false Kernel is not patched.
bool isPreemptible();
} // namespace rt
} // namespace kernel
} // namespace villas