Subj : Re: Thread priority and policy To : comp.programming.threads From : steve Date : Tue Mar 22 2005 06:48 am In article <1111468487.585118.195430@z14g2000cwz.googlegroups.com>, wrote: [ Please don't top-post, why will be evident in a moment ] > i m porting it from Solaris 5.2 version >so i was able to create the POSIX equvivalent of bounded and detached >thread. The Solaris term is "bound", not "bounded". The equivalent POSIX term is "system contention scope". >in my application >thread A recvs Multicast pkt >thread B writes it into a journl file (mainly for bk up >in thread c the rcvd pkt processed and it is published on a tcp > >i want to make thread A to have the highest priority than thread B and >C David asked some important questions that you should consider and answer: >David Butenhof wrote: >> Hema wrote: [ snip ] >> > while processing i make the thread A as a RealTime thread by changing >> > it class to SCHED_RR(shuld i go for SCHED_FIFO or SCHED_RR??) >> >> I don't know -- what are the realtime REQUIREMENTS of your application? >> Presumably there are some, since you're using realtime scheduling. >> Without knowing WHY and HOW you're depending on priority scheduling, we >> cannot answer that question for you. This is the core: What problem are you attempting to solve by changing thread priorities? Is it just that "it seems like a good idea", or is there some specific deadline that you must assert priority processing? Remember, real-time does not equal real-fast. In fact, the opposite is usually the case -- real-time systems are not fast, but they are predictable. [ snip ] Also, looking at your threading usage, it seems like you have designed a system to cause the greatest amount of system overhead possible; a single packet forces a minimum of two context switches. That doesn't scale well to higher traffic rates. Is there some reason the design can't simply be single-threaded? Based on what you've shared so far, a simple select() loop should be able to do hundreds of thousands of packets per second, assuming your journal system can keep up. -- Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" Internet: steve @ Watt.COM Whois: SW32 Free time? There's no such thing. It just comes in varying prices... .