检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:杨凯乔 YANG Kai-qiao(Department of Civil Engineering, CHANG’AN University of XINGHUA College, Xi’an 710077, China)
机构地区:[1]长安大学兴华学院土木工程系,陕西西安710077
出 处:《电脑知识与技术》2019年第3X期55-58,共4页Computer Knowledge and Technology
摘 要:针对环形缓冲区传统实现中判断"满"状态采用保留缓冲区元素或者引入缓冲区有效数据变量导致的缓冲区空间利用率较低问题,本文提出了一种新的不引入计数变量、不存在内存浪费的缓冲区实现方法,其核心思想是借助于读写索引之间的关系,使得读写索引一直递增而不清零,直到递增溢出后自动清零,该读写索引的差值就是缓冲区有效数据的个数。基于以上原理给出了不可覆盖和可覆盖环形缓冲区的实现过程,缓冲区"满"状态时,内存利用率为100%,并且仿真实验表明代码执行效率优于传统方法。According to problem involving in the ring buffer in the traditional implementation judgment "full" state with retaining an element without introducing cache data or effective number of variables makes utilization rate of the buffer space lower, a new the realization method of a new buffer is proposed in this paper without counter variables introduced and memory waste. The main ideas is based on the relationship between reading and writing index, the read-write index always increase until automatic reset when overflow. The number of valid data in buffer is read and write index difference. Based on the above principle gives the realiza. tion process for the ring buffer override or not override. The method of memory utilization rate is 100% when the buffer is in "full" state. The simulation experiment shows that the code execution efficiency is better than the traditional method.
分 类 号:TP212.9[自动化与计算机技术—检测技术与自动化装置]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:216.73.216.15