LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Creating An Uninterruputable Process from User Space (https://www.linuxquestions.org/questions/linux-software-2/creating-an-uninterruputable-process-from-user-space-4175585139/)

HalfMadDad 07-20-2016 12:14 PM

Creating An Uninterruputable Process from User Space
 
Hi Everyone

I am thinking about using a Raspberry Pi or Beagleboard to control slave microcontrollers via SPI.

I may need to have these microcontrollers performing in tandem. Not really tight tolerances but synchronized in the kHz range.

If I call a function to pass instructions to the microcontrollers, the call should end fairly quickly, perhaps 100 milliseconds to 1 second but that is a really long time for an OS which might decide to go and check for emails or whatever in the meantime, losing synchronization of the microcontrollers.

I want the call to be uninterruputable, is there a way to do this from Linux? I can use C for this.

Thanks-Patrick

sundialsvcs 07-22-2016 07:44 AM

"Uninterruptible?" No, and you wouldn't want it to.

All that you really need is to be certain that the control processes are given a better-than-normal execution priority, so that the scheduler will favor them and switch to them quickly, pre-empting other activity. (Given that CPUs do things with nanosecond timing, "100 milliseconds" is eternity.)

Also, this board will only do what you give it to do. Unless you particularly want your Beagle to fetch your mail (or your morning newspaper) for you, of course it won't. If your board doesn't have anything to do but to service those controllers, you probably don't need to do anything with execution priorities at all, because the board will have nothing else to do.

Linux is, by design, not an RTOS = Real-Time Operating System. But, you don't seem to require that here.

HalfMadDad 07-23-2016 06:09 AM

Thanks sundialsvcs. I am looking into the nice command now. Have a great day


All times are GMT -5. The time now is 09:03 AM.