At this time last year, it has already begun to do a complete set (today also some people into the laboratory to do); Review the distribution, the first time I heard that there is a third way to build the server: To do with the FSM. Always thought that in addition to the most clumsy sequential flow, only rely on the OS multithreading to do. Fsm. For complex control conditions and a large number of message states will not "explode" it. Like that year, do single-chip communication processing module, self-righteous use of FSM to design, the results when the need to modify the communication protocol, check Switch-case/if-else control flow let my hair suddenly increase ... Today, I was fortunate enough to find a piece of article: to build a finite state machine for Linux applications, this article introduces two kinds of FSM auxiliary design tools: Fsme is the next Linux based on Qt State Machine Modeling tool, it can automatically generate state machine framework code, and also support C + + and Python language, through the web http://fsme.sourceforge.net/You can learn more about fsme and be able to download the latest version of Fsme.
QFSM is also a state machine modeling tool running under Linux, it not only provides the visual state machine editor, but also can simulate the generated state machine in real time, through the website http://qfsm.sourceforge.net/can learn more information about QFSM.
Of course, FSM itself is an important part of UML.
In other words, FSM is a product of SISD (single instruction streaming single data stream) system, program execution process is completely under the control of the code structure, the implementation of the environment no more interference (such as interruption, context switching), such as on the SCM is not multithreading support, so in order to achieve performance requirements, Using non-blocking communication operation, only FSM design mode is adopted.