摘要: 在多实例多线程情况下,ActiveX组件的不同实例共享同一全局数据缓冲区,在改造集成面向过程开发的传统代码时必须修改代码以消除全部全局变量。针对该情况,使用线程局部存储技术实现全局变量的局部化,采用具有大量全局变量的实体仿真代码实现ActiveX封装。该技术已成功应用于基于工业以太网的多通道数控系统中。
关键词:
数控系统,
线程局部存储,
组件对象模型,
ActiveX组件
Abstract: In multiple instance and threads runtime system, global variables of the component are shared by each instance. When using ActiveX to integrate historical codes, such global variables must be removed by modifying source code. Aiming at this situation, this paper uses the Thread Local Storage(TLS) technology to realize the localization of global variables, and uses the entity simulation codes which have a large number of global variables to realize the encapsulation of ActiveX. The ActiveX implementation is successfully applied in a new generation of Ethernet based multiple channel Computer Numeric Control(CNC) system.
Key words:
Computer Numeric Control(CNC) system,
Thread Local Storage(TLS),
Component Object Model(COM),
ActiveX component
中图分类号:
王晓宇, 陈吉红, 唐小琦. 基于线程局部存储技术的多通道数控系统仿真[J]. 计算机工程, 2010, 36(14): 204-205.
WANG Xiao-Yu, CHEN Ji-Gong, TANG Xiao-Qi. Simulation of Multiple Channel Computer Numeric Control System Based on Thread Local Storage Technology[J]. Computer Engineering, 2010, 36(14): 204-205.