I am developing a multi threaded application in C. In my application there are 40 threads which receives the UDP packets from 40 different ports and place the data into the queues (40 queues for 40 ports). Now there are another 40 data processing threads which takes the data from the respective queues and process them. The current scheduling of policy of my threads are SCHED_OTHER
.
The problem is that some port listening threads are missing the packets. What can I do to solve this problem. I have some solutions in my mind:
a) Making the data reading threads real-time. How can I make it? (Will it starve the data processing threads from CPU?).
b) Increasing the nice level of my whole application (it is not solving the problem).
c) ?
I am using Pthreads.