Institute of Plasma Physics, Chinese Academy of Sciences, Hefei 230031, China
Funds: supported by National Natural Science Foundation of China (No.11075183), the Knowledge Innovation Program of the Chinese Academy of Sciences (the study of neutral beam steady-state operation of the key technical and physical problems)
To ensure the uniqueness and recognition of data and make it easy to analyze and process the data of all subsystems of the neutral beam injector (NBI), it is required that all subsystems have a unified system time. In this paper, the timing synchronization software is presented which is related to many kinds of technologies, such as shared memory, multithreading, TCP protocol and so on. Shared memory helps the server save the information of clients and system time, multithreading can deal with different clients with different threads, the server works under Linux operating system, the client works under Linux operating system and Windows operating system. With the help of this design, synchronization of all subsystems can be achieved in less than one second, and this accuracy is enough for the NBI system and the reliability of data is thus ensured.