LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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.

Notices


Reply
  Search this Thread
Old 05-09-2010, 01:19 PM   #1
thespartan
LQ Newbie
 
Registered: May 2010
Posts: 1

Rep: Reputation: 0
Wink 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.
 
Old 05-10-2010, 07:55 AM   #2
fpmurphy
Member
 
Registered: Jan 2009
Location: /dev/ph
Distribution: Fedora, Ubuntu, Redhat, Centos
Posts: 299

Rep: Reputation: 62
Quote:
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.

Quote:
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.
 
  


Reply

Tags
pthread, scheduling



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pthread scheduling in ARM EmbeddedSteve Linux - Embedded & Single-board computer 3 02-05-2009 03:05 PM
problem in assigning real time scheduling to pthread in linux jasdeep_js Linux - Kernel 1 09-07-2008 01:44 AM
libtest.a uses pthread: user of libtest.a should not link pthread again debulu Programming 2 01-31-2007 09:23 PM
Pthread scheduling... msriram_linux Programming 3 11-21-2004 03:57 PM
pthread zaman Programming 6 08-29-2004 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration