You can find an article on writing real-time control loops in RTLinux inside the giant Hristu-Varsakelis, Levine Handbook of Networked and Embedded Control. The article is by Edgar Hilton, Matt Sherer and myself and covers simple loops, loops with data and control going to the non-real-time “client” and loops using the Interface Kit (XML/RPC).

Handbook of Networked and Embedded Control Systems