pthread scheduling
Hi all,
I am writing a server program. During the initialization stage, it spawns 100 pthreads to handle clients (I am doing this because, I thought pthread_create is a costly fn and increases my response time if I create them dynamically when request come in.) Then as the requests start coming in, I assign a thread to handle each connection. The problem with this apprach is the server is not fast enough, and sometimes the client requests time out.. I read that this may be improved by setting higher priority to your process.
so , my question is, how to make my process high priority so that cpu allocates longer time for all the threads in my process.
Is it reasonable to expect that all the threads in my process will get high priority if I make my process high priority. Are threads of a process scheduled within the time allocated for a process or are they considered part of a global pool of lwp and independently scheduled?
can anyone give me some pointers or tutorial sites that explain these topics.
Last edited by thespartan; 05-09-2010 at 01:34 PM.
|