From c67b4d895748a11d6e0176fb61943db2118f0cc9 Mon Sep 17 00:00:00 2001 From: DeDo304 <88462872+DeDo304@users.noreply.github.com> Date: Mon, 9 Aug 2021 14:35:14 +0630 Subject: [PATCH] help high --- src/Peuck.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Peuck.cpp b/src/Peuck.cpp index c94d914..e2a76fe 100644 --- a/src/Peuck.cpp +++ b/src/Peuck.cpp @@ -13,7 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include +#include +#include + +pid_t my_pid; // PID of the process containing your thread. +// Assumes that cpu0, cpu1, cpu2, and cpu3 are the "slow CPUs". +cpu_set_t my_cpu_set; +CPU_ZERO(&my_cpu_set); +CPU_SET(0, &my_cpu_set); +CPU_SET(1, &my_cpu_set); +CPU_SET(2, &my_cpu_set); +CPU_SET(3, &my_cpu_set); +sched_setaffinity(my_pid, sizeof(cpu_set_t), &my_cpu_set); #define LOG_TAG "Peuck" #include "Trace.h"