LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Q about linux kernel tasks (https://www.linuxquestions.org/questions/linux-general-1/q-about-linux-kernel-tasks-4175421258/)

laro1983 08-09-2012 01:46 PM

Q about linux kernel tasks
 
Hi

Iam using Red hat (v6.1 with MRG) and have a multicore server (with 4 cores)

I have a program (a task with a 30+ thread), and most of those threads are synchronic and the other are asynchronic threads.
Several of the asynchronic threads send and receive data via sockets and the other write logs into files.

The scheduling of my program (and all the threads are RT - FIFO)

I need to set priorities to those threads.

My Q is:
If I set all those threads (my all 30+ threads) with priorities between 20 to 99, are the Linux kernel Tasks will be starved ?

for example there are Linux kernel tasks which responsibility to write or send the actual data in the socket.
And if all my threads will be in higher priorities from those of the kernel, the data wont be send or received from the sockets ?

sundialsvcs 08-09-2012 01:51 PM

You probably need to reduce the number of threads. Do you have 30 interface adapters? If not, then all 30 of those sockets cannot receive data at the same instant, and therefore a simple select-loop will do. If the processing is more complicated, let one select-driven process handle the I/O intake, then drop the messages onto an in-memory queue for consumption by other threads. It is both completely unnecessary and probably counter-productive to have many threads.

Use asynchronous writing (handled by a separate process) to do the log-writing.

:tisk: Don't :tisk: monkey-around with thread priorities, especially in the low ranges. They will not help you. What you will actually get is an unreliable process that cannot respond consistently and efficiently under load.


All times are GMT -5. The time now is 11:14 PM.