Lock-free Fill-in Queue

Basem Assiri
{"title":"Lock-free Fill-in Queue","authors":"Basem Assiri","doi":"10.1109/ICCIS49240.2020.9257673","DOIUrl":null,"url":null,"abstract":"One of the fundamental data structure that is commonly used in parallel and concurrent systems is first-in-first-out queue. Many studies propose lock-based concurrent queue algorithms to satisfy correctness property. However, the use of locks results in delays, contention, deadlock and some other issues. Instead, lock-free algorithms are introduced to overcome such issues and improve performance. Some lock-free algorithms use an atomic operation compare-and-swap (CAS) while some others replace it with fetch-and-add (FAA), to improve the performance. From implementation perspective, some queue algorithms use array data structure to ease the enqueuing and dequeuing processes but the size of queue is static. On the other hand, many queue algorithms use linked data structure where the size of queue is dynamic but the enqueuing and dequeuing processes are complicated. In this paper, we introduce new algorithms for concurrent queue that merge the ideas of array and linked data structure to get the advantages of both. Actually, our queue consists of circular linked list with $k$ empty (dummy) nodes. Therefore, in normal case it works like array. The enqueue process places the data in one of the empty nodes (at tail position), while the dequeue process deletes the data from a non-empty node (at head position), and no need to maintain the linked list queue. However, our queue is dynamic such that we change the queue size by either creating new node and connect it to the linked-list, or deleting some exist nodes. Our algorithm eases the enqueue and dequeue processes, and reduces the use of CAS operations. Therefore, it improves the performance comparing to existing queue algorithms that use CAS, and almost matches the performances of the algorithms that use FAA.","PeriodicalId":425637,"journal":{"name":"2020 2nd International Conference on Computer and Information Sciences (ICCIS)","volume":"107 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-10-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2020 2nd International Conference on Computer and Information Sciences (ICCIS)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICCIS49240.2020.9257673","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

One of the fundamental data structure that is commonly used in parallel and concurrent systems is first-in-first-out queue. Many studies propose lock-based concurrent queue algorithms to satisfy correctness property. However, the use of locks results in delays, contention, deadlock and some other issues. Instead, lock-free algorithms are introduced to overcome such issues and improve performance. Some lock-free algorithms use an atomic operation compare-and-swap (CAS) while some others replace it with fetch-and-add (FAA), to improve the performance. From implementation perspective, some queue algorithms use array data structure to ease the enqueuing and dequeuing processes but the size of queue is static. On the other hand, many queue algorithms use linked data structure where the size of queue is dynamic but the enqueuing and dequeuing processes are complicated. In this paper, we introduce new algorithms for concurrent queue that merge the ideas of array and linked data structure to get the advantages of both. Actually, our queue consists of circular linked list with $k$ empty (dummy) nodes. Therefore, in normal case it works like array. The enqueue process places the data in one of the empty nodes (at tail position), while the dequeue process deletes the data from a non-empty node (at head position), and no need to maintain the linked list queue. However, our queue is dynamic such that we change the queue size by either creating new node and connect it to the linked-list, or deleting some exist nodes. Our algorithm eases the enqueue and dequeue processes, and reduces the use of CAS operations. Therefore, it improves the performance comparing to existing queue algorithms that use CAS, and almost matches the performances of the algorithms that use FAA.
无锁填充队列
并行和并发系统中常用的基本数据结构之一是先进先出队列。许多研究提出了基于锁的并发队列算法来满足正确性。但是,使用锁会导致延迟、争用、死锁和其他一些问题。相反,引入无锁算法来克服这些问题并提高性能。一些无锁算法使用原子操作比较-交换(CAS),而其他一些算法则使用获取-添加(FAA)来替代它,以提高性能。从实现的角度来看,一些队列算法使用数组数据结构来简化排队和脱队过程,但队列的大小是静态的。另一方面,许多队列算法采用链接数据结构,队列的大小是动态的,但排队和脱队过程比较复杂。本文介绍了一种新的并行队列算法,它融合了数组和链接数据结构的思想,以获得两者的优点。实际上,我们的队列由具有$k$空(虚拟)节点的循环链表组成。因此,在正常情况下,它像数组一样工作。队列进程将数据放在一个空节点中(在尾部位置),而脱队列进程从非空节点(在头部位置)删除数据,并且不需要维护链表队列。但是,我们的队列是动态的,因此我们可以通过创建新节点并将其连接到链表或删除一些现有节点来更改队列大小。该算法简化了排队和退队过程,减少了CAS操作的使用。因此,与使用CAS的现有队列算法相比,它的性能得到了提高,并且几乎与使用FAA的算法的性能相匹配。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信