Remove hard-coding of no of threads

Script added to set the no of threads according to run-time conditions of the machine.
This commit is contained in:
Sakthivel Velumani
2020-11-23 16:45:59 +01:00
parent 40141270e3
commit f55a4dd8e0
+8 -1
View File
@@ -869,7 +869,14 @@ void init_gNB_proc(int inst) {
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
char ul_pool[] = "-1,-1";
int numCPU = sysconf(_SC_NPROCESSORS_ONLN);
char ul_pool[80];
sprintf(ul_pool,"%d",1);
int s_offset = 0;
for (int icpu=2; icpu<numCPU; icpu++) {
sprintf(ul_pool+1+s_offset,",%d",icpu);
s_offset += 2;
}
initTpool(ul_pool, gNB->threadPool, false);
initNotifiedFIFO(gNB->respDecode);
}