611 Subj : Re: pthread priorites To : comp.programming.threads From : loic-dev Date : Fri Oct 07 2005 01:10 am Salut Gopi, > BeOS has 20 more priorities, Yes I can my rearrange my code so that it > doesn't cross the PRIORITY_MAX limit, but I want to know is there a way > to have more priorities (increase the Priority_max). Not without modifying the kernel source, AFAIK. I don't know how much effort that would be, though. IIRC, in the context of Real-Time scheduling policy, you could tune the time quantum of a process with the nice value. This feature was a consequence how things got implemented for time sharing scheduling, not necessarily a wanted design ( and needless to say, it is highly non portable). IOW, you can't use the nice value to get more priorities. > Reason being all my thread get various priorities at the beginning, > according to what they are going to do. If a thread with less priority > has to run right away I bump up priority and when this thread gets a > higher priority it can complete what ever it is suppose finish. > > This Bumping up is sometimes priority+10 or 20 or 30 depending upon the > requirement. I certainly don't know your exact requirements... But if you have three tasks running at prio 10,20 and 30 resp. You will obtain the same scheduling if the tasks runs at prio 1,2 and 3 resp. Leaving a gap between priorities is e.g. useful when your application is subject to add more tasks whose priorities should be between the existing ones. HTH,=20 Lo=EFc. . 0