1. A state machine for use in a process control system for managing processing of inter-task messages between tasks under control of a real-time operating system, the inter-task messages created as a result of hardware events and software events, the state machine comprising: a first data structure containing one or more first entries, each said one or more first entries including: a pointer to a second data structure, and a counffield, said one or more first entries each representative of a state, and said count field representative of a count of events valid for said state; and a said second data structure containing one or more second entries, each said one or more second entries including a Type field, an Event field, a Message ID field, and a state transition routine pointer for providing the address of the state transition routine.