Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
Is it reasonable to expect that all the threads in my process will get high priority if I make my process high priority.
In general, no.
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?
It depends on the implementation of the Pthread library you are using. It may be implemented as green threads, 1:1 theads or M:N threads. You simply have not provide enough information for anybody to give you a definitive answer.