nr-uesoftmodem: don't set priority, check for SYS_NICE

The main thread of nr-uesoftmodem (executing main()) is mostly working;
it is thus not necessary to set high priority. Instead, the threads
created with threadCreate() will receive higher priority, if possible
(as determined by the availability of SYS_NICE capability).

To inform if SYS_NICE is not present, print a warning in main().
This commit is contained in:
Robert Schmidt
2024-06-03 14:00:49 +02:00
parent 66bf27bce9
commit 37f3f0b6a4
+4 -4
View File
@@ -456,10 +456,6 @@ ldpc_interface_t ldpc_interface = {0}, ldpc_interface_offload = {0};
int main(int argc, char **argv)
{
int set_exe_prio = 1;
if (set_exe_prio)
set_priority(79);
start_background_system();
if ((uniqCfg = load_configmodule(argc, argv, CONFIG_ENABLECMDLINEONLY)) == NULL) {
@@ -484,6 +480,10 @@ int main(int argc, char **argv)
//randominit (0);
set_taus_seed (0);
if (!has_cap_sys_nice())
LOG_W(UTIL,
"no SYS_NICE capability: cannot set thread priority and affinity, consider running with sudo for optimum performance\n");
cpuf=get_cpu_freq_GHz();
itti_init(TASK_MAX, tasks_info);