TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: THE NATURAL PHILOSOPHER
from: COMPUTER NERD KEV
date: 2020-09-15 11:12:00
subject: Re: Just how much bloat c

The Natural Philosopher  wrote:
>
> So my next questions are:
>
> 1/. How much latency do the kernel thread processes conceivably
> introduce? There are an awful lot of them. If these are insurmountable
> that really rules out Linux altogether.
>
> 2/. How interruptible are they by interrupts coming from the Pi's GPIO
> pins? I want my handler to have top priority for its run - whose length
> is a bit indeterminate till I know how fast the pi executes floating point.

I've been dealing a lot with Pi interrupts in Linux lately, but with
a somewhat different application to yours. In my case I've ended up
cheating my way out of setting up an interrupt-driven system in Linux
(for now) by avoiding/disabling the system interrupts and polling an
input.

These are my links for when I go back and try to implement things
"properly" so that I'm not wasting so many cycles polling (I believe
I'll have to write a Linux kernel driver, but my timing requirements
are much tighter than 50ms):

*Interrupts can be used to avoid polling the edge detection register.
 Need to use the Linux GPIO subsystem and poll() in C.
 -A sort-of example:
  
https://stackoverflow.com/questions/34808276/poll-on-raspberry-gpio-sysfs-raspb
erry
 -Best (fastest) interrupt handling would require a proper Linux
  device driver. Or running bare-metal.
  -Example of the latter: https://github.com/enricorov/Pinterrupt
 -See: https://www.raspberrypi.org/forums/viewtopic.php?p=1149836
   -- Notes some measured interrupt response times
 -Some valuable low-level info:
  http://xinu.mscs.mu.edu/Interrupt_handling_(Raspberry_Pi)
 -Hints at usage with Linux:
 
https://www.iot-programmer.com/index.php/books/22-raspberry-pi-and-the-iot-in-c
/chapters-raspberry-pi-and-the-iot-in-c/55-raspberry-pi-and-the-iot-in-c-input-
and-interrupts?start=1
  -Getting into it properly here:
  
https://www.iot-programmer.com/index.php/books/22-raspberry-pi-and-the-iot-in-c
/chapters-raspberry-pi-and-the-iot-in-c/55-raspberry-pi-and-the-iot-in-c-input-
and-interrupts?start=2

--
__          __
#_ < |\| |< _#

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.