摘要
多核CPU在不同的内核间同步,通常采用核间自旋锁的方法来保证多核之间互斥。核间自旋锁的使用频度需要根据CPU的核处理能力和用户程序对CPU总体处理能力的要求来进行权衡。如果核间自旋锁的使用过于频繁或核上加锁周期过长,就会导致CPU的单位时间资源使用率过高,使用户代码功能的执行效率降低。为解决核间自旋锁在使用过程中遇到的问题,文章提出的解决方案是在为核间自旋锁加锁和解锁过程增加相应的调试信息,然后针对不同情况进行扫描队列或新增核间自旋锁。
In different inter-core synchronization technologies in multi-core CPU,the inter-core spin lock method is often inevitably used.The frequency of the usage of inter-core spin locks needs to be weighed according to the CPU’s core processing capability and the user program’s requirements on the CPU’s overall processing capability.If the inter-core spin lock is used too frequently or the lock period on the core is too long,the CPU’s resource utilization per unit time will be too high and the execution efficiency of user code functions will be reduced.For this reason,the paper proposed to add corresponding debugging information to the inter-core spin locking and unlocking process,and to use the solution of scanning queue or adding inter-core spinlock for different situations.
作者
阳丽
YANG Li(School of Information and Computer Engineering,Pingxiang University,Ping Xiang,Jiangxi 337000,China)
出处
《萍乡学院学报》
2021年第6期73-76,共4页
Journal of Pingxiang University
关键词
核间自旋锁
多核CPU
核处理能力
inter-core spin lock
multicore CPU
core processing power