Aiming at Shared memory problems of CNC system based on RTAI extension with domestic Loongson CPU, study the RTAI shared memory mechanism, shared memory pool and memory block two-grade management data structure is taken, on the encapsulation of RTAI shared memory allocation and release functions, design allocation algorithm and the release algorithm, achieve a high efficient management of the shared memory with C language. Experimental results show that the method is effective to reduce CNC system' s the shared memory allocation and release time-consuming, and improves CNC system' s shared memory management efficiency.%针对基于国产龙芯CPU的RTAI扩展的数控系统的共享内存问题,通过对RTAI共享内存实现机制的研究,设计共享内存池和共享内存块两级管理数据结构,在RTAI提供的共享内存分配和释放函数的基础上,设计了一种分配算法和释放算法,并使用C语言实现一个高效的共享内存管理层.经验证,该设计有效降低了数控系统共享内存分配和释放的时间耗费,提高了数控系统的共享内存管理效率.
展开▼