I have a similar question. Here's my attempt to define "how realtime" my project needs. I'd appreciate any comments on how feasible it is on an RPI 3B+ running stretch. Do I need to dedicate a core? Is even that sufficient, or do I need a separate, dedicated processor?
An "event queue" will exist that will include events that have :
- a timestamp for when the event was posted
- a delay for when the associated action should be started
I was thinking I could use pigpio C I/F to get a timestamp on a GPIO transition that coincides with completion of a message from a UART. I think this timestamp accuracy could be a few usecs (or maybe better)? @joan?
The event_queue will be read every 1 msec. The code at that point will have to get a "now" time and will run the action code if current time is greater than the event time + delay.
Can I expect to get at least +/- 1 msec accuracy for when the action code runs?
Once the action code starts running, can interrupts be disabled until the code completes? Is there a limit on how long the interrupts can be disabled?