Better to be a bit more specific:
Are you wanting to
Use an RTOS? Have a google look at FreeRTOS
Build an RTOS yourself? Difficult, but doable. See above for examples
Writing programs that resond in real-time to events? Use interrupt-driven systems
Thanks to both of you.
You can also do a state machine implementation. There are a few specific ones in the cypress app notes or you can use something like the QP framework (http://www.state-machine.com/). It was fairly easy to get that one runing, though actually using it has a bit of a steep and long learning curve (at least for me)