Set nice to -20 for buffer

This commit is contained in:
2020-05-11 18:27:33 +02:00
parent 53bf0445d3
commit 78aa0b6d71
+9
View File
@@ -7,6 +7,10 @@
#include "jungfrau.hpp"
#include "BufferUdpReceiver.hpp"
#include <sys/resource.h>
#include <syscall.h>
using namespace std;
using namespace core_buffer;
@@ -26,6 +30,11 @@ int main (int argc, char *argv[]) {
exit(-1);
}
pid_t tid;
tid = syscall(SYS_gettid);
int ret = setpriority(PRIO_PROCESS, tid, -20);
if (ret == -1) throw runtime_error("cannot set nice");
string device_name = string(argv[1]);
int udp_port = atoi(argv[2]);
string root_folder = string(argv[3]);