Steven Seeger wrote: > I have a xenomai userspace application that does the following: > > A thread of priority 90 toggles a bit (outb) to move a stepper motor. > > A thread of priority 10 updates the display once a second. > > The motor thread is periodic and uses rt_task_wait_period(). The display > thread just uses sleep(1). > > My question is this: the priority 90 thread is higher priority, and doesn't > do anything relating to linux system calls. Whenever the display thread > updates the display, the motor thread stalls momentarily. > > Any idea why this is?
If your motor thread really looks like while (1) { toggle_bit(); rt_task_wait_period(); } you may suffer from contentions of the related bus towards your motor (what kind of interface do you use?). To test this, just put some instrumentation around the toggle_bit() (take timestamps and look for abnormal delays). What frequency is your motor thread running at? If there is more code in your loop, please post the program (or a simplified but still failing version). Jan
signature.asc
Description: OpenPGP digital signature