Bozitaai wrote: > Platform => *Linux 2.4.32 with RTAI* > Development in User Space > *SCHED_FIFO with preemption* is enabled. > > I am developing the UDP Scheduler, which sends the UDP packets at particular > time, the target transport rate is 20Mbits/s and the time different between > each UDP packet is about 500 microseconds. The transmission time must be > very precisely, otherwise the buffer of receiver will be under-flow or > over-flow. > > In my program, nanosleep function is used to control the time, and try to > program the RTC to generate a 10khz interrupt stream and use that. Most of > time the UDP packets can be sent to the receiver with precision time, but I > observed the kernel sometimes schedules to do other lower priority tasks. > It makes my program sometimes occurs LONG DELAY, about 20 ~ 60 milliseconds, > and my program can't use 100% resource of whole Linux system. > > I was trying different methods, for example, low-latency patch, preemption > patch and hrt patch, but the problem still doesn't been solved. > > Any idea can share with me?
Look at existing examples in the RTnet source tree. There is "frag-ip" for instance, demonstrating periodic UDP packet emission (and reception) under Xenomai, but porting this to RTAI should be straightforward. Do not use standard nanosleep unless this service was wrapped on a rt-safe variant (like the POSIX skin under Xenomai does). Jan PS: I think we already provided some hints to you. If you do not understand specific suggestions, please ask directly, but avoid re-posting (almost) the same question.
signature.asc
Description: OpenPGP digital signature