Re: Two real time tasks?
victor yodaiken <[email protected]> Fri, 11 Feb 2005 04:59:42 -0700
| Newsgroups | gmane.linux.real-time.rtlinux.general |
|---|---|
| Organization | FSM Labs |
| Message-ID | <[email protected]> |
POSIX priorities are higher number, higher priority. In the original RTLinux, we used the reverse approach so that 0 was always highest priority, but POSIX makes more sense. On Thu, Feb 10, 2005 at 06:39:08PM -0500, Chris Smolinski wrote: > I did use priorities, and I am not seeing preemption. I am calling > pthread_setschedparam() at the beginning of the real time threads > with sched_priority in the sched_param set to a higher number for the > slower running test. Is this not the correct way to do it? > > >Use priorities so that the faster task can preempt. > > > >On Thu, Feb 10, 2005 at 01:47:40PM -0500, Chris Smolinski wrote: > >> I have a question concerning running two real time tasks at once. > >> I've created two such tasks, one running every 250 microseconds, and > >> one every 10 millieconds. For testing purposes, I have each test turn > >> a parallel port line on when the task starts to run, and off just > >> before it goes back to sleep. Viewing the two outputs on a scope, > >> everything looks fine. > >> > >> But, if the slower task takes longer than 250 microseconds to run > >> (actually the problem happens before then), it is not pre-empted to > >> allow the faster task to run. Instead, once it is done, the faster > >> task runs, and then the next instance of the faster task runs > >> earlier, presumably so that the average execution rate remains 250 > >> microseconds. > >> > >> Is there anything I can do to have execution of the slower task > >> halted to allow the faster task to run at the correct time, and then > >> return to the slower task when the faster task is finished? > >> > >> -- > >> > >> --- > >> Chris Smolinski > >> Black Cat Systems > >> http://www.blackcatsystems.com > >> _______________________________________________ > >> Rtl mailing list > > > [email protected] > >> http://www2.fsmlabs.com/mailman/listinfo/rtl > > > >-- > >--------------------------------------------------------- > >Victor Yodaiken > >Finite State Machine Labs: The RTLinux Company. > >www.fsmlabs.com www.rtlinux.com > >1+ 505 838 9109 > > > -- > > --- > Chris Smolinski > Black Cat Systems > http://www.blackcatsystems.com -- --------------------------------------------------------- Victor Yodaiken Finite State Machine Labs: The RTLinux Company. www.fsmlabs.com www.rtlinux.com 1+ 505 838 9109 _______________________________________________ Rtl mailing list [email protected] http://www2.fsmlabs.com/mailman/listinfo/rtl