real time programming is nothing you can learn from a post in a forum. There are many things you are not allowed to do in your real time application. And it starts with you need to ensure that your program doesn't need to load pages from the storage. So all parts of your real time application needs to stay in memory (https://linux.die.net/man/2/mlockall
) Then you need to make sure you never block on for example I/O. So you can't write any files or to any I/O from your real time thread/process. And many things more.
Realtime development has nothing to do with cyclic programming. An SPS uses a cycle which is deterministic and thus you can implement realtime use cases with it. Realtime only says an event can be handled in a defined time.
There are some limiting conditions on the RevPi. We use kernel threads with realtime priorities to implement the communication with the extension modules. Also some other driver use realtime priorities. Also the communticaton with the extension modules is done in a cyclic manner. Which leaves you with a delay from the point when an event occurred (on the extension modules) a until you can process this event.
I hope this rather shallow overview helped you.