鹦鹉叫什么名字好听| 布谷鸟叫有什么征兆| 什么人容易得甲亢| 什么店可以买到老鼠药| 牙龈疼痛吃什么药| 什么的麦子| 什么是脂肪肝| 为什么低烧比高烧可怕| 降血脂吃什么食物| 一什么池塘| roma是什么牌子| 十月份出生的是什么星座| 做肠镜前一天可以吃什么| 酒石酸是什么| 开火上下结构念什么| 真菌怕什么| 初恋是什么| 教师节送什么礼物呢| 呼吸困难吃什么药| 梦见下雪了是什么意思| 羟基丁酸在淘宝叫什么| 道德经适合什么人看| 尿痛挂什么科| 梦见吃螃蟹是什么预兆| 吃什么食物能升白细胞| 1月1日什么星座| 忆苦思甜下一句是什么| 金晨什么星座| 鸡胸是什么病| 交警中队长是什么级别| 后巩膜葡萄肿是什么意思| 65年出生属什么| 梦见邻居是什么意思| 做梦梦到牙齿掉了是什么意思| 5.3什么星座| 梦见以前的朋友是什么意思| 天时地利人和是什么意思| 内鬼是什么意思| 10月6日什么星座| 什么生日的人有佛缘| 吾日三省吾身是什么意思| 牙龈翻瓣术是什么意思| 手掌发红是什么病| 唐宝是什么意思| 什么是双减| 慢性萎缩性胃炎吃什么药| 肾结石有什么表现症状| 赤道2什么时候上映| 肺动脉增宽是什么意思| 2008属什么| 晚上九点是什么时辰| 柠檬是什么季节的水果| 妊娠纹什么时候开始长| jeep是什么意思| 尿尿疼是什么原因| 例假一个月来两次是什么原因| 231是什么意思| 羊传染人的病叫什么名| 鸡壳是什么| 玉子是什么| 青蛙爱吃什么| 比特币是什么意思| 14年属什么| 守字五行属什么| 桑葚有什么功效和作用| 玉米糁是什么| 阴茎进入阴道是什么感觉| 生脉饮适合什么人喝| 阿迪达斯neo什么意思| 尿酸检查什么项目| 高考什么时候结束| 食管反流什么症状| 天恩是什么意思| 子宫憩室是什么意思| 西夏国是现在什么地方| 肝囊性灶是什么意思| 金黄色葡萄球菌是什么菌| 看嗓子去医院挂什么科| 画地为牢下一句是什么| 红眼病滴什么眼药水| 胸口堵是什么原因| 吃完羊肉不能吃什么水果| 路人皆知的上一句歇后语是什么| 湿热吃什么食物好得快| 手术室为什么在三楼| 乙状结肠管状腺瘤是什么意思| 代价什么意思| 青睐什么意思| 累觉不爱是什么意思| 肆虐是什么意思| ed是什么意思| 一五行属性是什么| 螳螂喜欢吃什么| 3月有什么节日| hsg是什么检查项目| 夜宵吃什么好| 什么什么各异| 喉咙痒吃什么药好| 过期的钙片有什么用途| 后脑勺疼什么原因| cp是什么| 单核细胞高是什么感染| 为什么老是出汗| 盐酸氟桂利嗪胶囊治什么病| 粉红色泡沫样痰是什么病| 用什么自慰| 寒颤是什么意思| 军分区司令是什么级别| 河蚌为什么没人吃| 玉米是什么时候传入中国的| 阴阳脸是什么意思| 十二指肠霜斑样溃疡是什么意思| 三更是什么生肖| 武松打的是什么虎| 为什么不建议做融合手术| 免疫治疗是什么意思| 姑姐是什么意思| 梦见很多蜘蛛是什么意思| 来字五行属什么| cmr医学中什么意思| 凿壁偷光是什么意思| 来大姨妈吃什么水果好| 捉虫是什么意思| 前壁后壁有什么区别| 桑黄是什么东西| 检查胃挂什么科| 什么是磁共振检查| xswl什么意思| 人流是什么| 副鼻窦炎症是什么意思| cto是什么职位| 吃什么补充dha| 垂体瘤挂什么科| 裙带菜是什么| 为什么手会不自觉的抖| 照看是什么意思| 阳历6月21日是什么星座| 稀释是什么意思| 早上七八点是什么时辰| 小孩吃鹅蛋有什么好处| 印堂发红是什么的征兆| 什么病会吐血| 今年22岁属什么| 守岁是什么意思| 心肌缺血用什么药| 蝙蝠来家里是什么预兆| 豆粕是什么| 21三体高风险是什么意思| 甲炎是什么病| 2006年什么年| 奴才是什么意思| 强度是什么意思| 牛字旁与什么有关| 1218是什么星座| 马革裹尸什么意思| 胃反酸水吃什么药| 高血压吃什么水果好| 梦见抽血是什么预兆| 哈库呐玛塔塔什么意思| 唐僧姓什么| 气血不足吃什么东西| 蒲公英叶和根的功效有什么不同| 舒字属于五行属什么| 10.25是什么星座| 宝宝肋骨外翻是什么原因| 老树盘根是什么意思| 周易和易经有什么区别| 茯苓有什么作用和功效| 昔日是什么意思| 双11是什么节日| 吃葵花籽有什么好处和坏处吗| 肝气郁结喝什么茶| 气管炎吃什么好| 刮宫和流产有什么区别| 红头文件是什么意思| 吃鸡蛋胃疼是什么原因| 牙龈肿痛吃什么药好| 月经期间吃西瓜有什么影响| 什么情况下做胃镜| 吃什么提高记忆力| 堃字的寓意是什么意思| 张飞的兵器是什么| 猫为什么流眼泪| 蔡英文是什么党| 2000年为什么叫千禧年| 落地生根是什么生肖| 中央民族大学什么档次| 梦见自己化妆是什么意思| 前置胎盘需要注意什么| 癌胚抗原是什么| 葛根主治什么病| 肚子胀挂什么科| 住院带什么必备物品| 草字头内念什么| 天为什么会下雨| oto是什么意思| 56个民族都有什么族| 扑尔敏是什么药| 体检需要带什么| 姜汁可乐有什么功效与作用| 什么的雨丝| 吃什么药能冲开宫腔粘连| 丰五行属什么| ntc是什么| mafia是什么意思| 头上戴冠是什么生肖| 抗核抗体谱检测查什么的| 水淀粉是什么粉| 红加绿等于什么颜色| 65什么意思| 我能说什么| 梦到下雨是什么意思| 孟子叫什么名字| 晚上三点是什么时辰| 台风什么时候到上海| 泉肌症是什么病| 无名指是什么经络| 单独是什么意思| levis是什么牌子| 沙葱是什么| 脚浮肿吃什么药| 放疗和化疗有什么区别| chemical是什么意思| 荷叶泡水喝有什么功效| ckd3期是什么意思| 3月18号是什么星座| 什么的枣子| 喉结肿大是什么原因| 咳嗽吃什么好得快| 肿瘤吃什么中药能消除| 吃西瓜有什么坏处| 怀孕什么水果不能吃| 有什么好听的网名| 72岁属什么| 咖啡加什么最好喝| 什么样的眼睛形容词| 早泄吃什么药最好| 眼睛发黑是什么原因引起的| black什么颜色| 恨不相逢未嫁时什么意思| 县武装部长是什么级别| 红蜘蛛用什么药最有效| 什么是水晶| 娘惹是什么意思| 骶1隐裂是什么意思| 光敏树脂是什么材料| 助听器什么价位| 什么是宫颈息肉| 无非是什么意思| 为什么会长生长纹| 实时更新是什么意思| 冰袋里面装的是什么| sk-ll是什么牌子| 尿酸高是什么症状| 猛吸气胸口疼什么原因| 上海新华医院擅长什么| 棋字五行属什么| 胃烧心吃什么食物好| 灭吐灵又叫什么名字| em是什么意思| ad是补什么的| 主动脉硬化吃什么药好| 蚕长什么样| 逆爱是什么意思| 百度Jump to content

什么人不适合喝骆驼奶

From Wikipedia, the free encyclopedia
Concurrent accesses to the same hash table.
百度 2018款吉利帝豪GS很快就将正式发布,外观升级已可见不同,内饰、配置等还有提升,比如用发动机取代现款的,售价如果能保持不变,那么整体性价比会提升。

A concurrent hash table or concurrent hash map is an implementation of hash tables allowing concurrent access by multiple threads using a hash function.[1][2]

Concurrent hash tables represent a key concurrent data structure for use in concurrent computing which allow multiple threads to more efficiently cooperate for a computation among shared data.[1]

Due to the natural problems associated with concurrent access - namely contention - the way and scope in which the table can be concurrently accessed differs depending on the implementation. Furthermore, the resulting speed up might not be linear with the amount of threads used as contention needs to be resolved, producing processing overhead.[1] There exist multiple solutions to mitigate the effects of contention, that each preserve the correctness of operations on the table.[1][2][3][4]

As with their sequential counterpart, concurrent hash tables can be generalized and extended to fit broader applications, such as allowing more complex data types to be used for keys and values. These generalizations can however negatively impact performance and should thus be chosen in accordance to the requirements of the application.[1]

Concurrent hashing

[edit]

When creating concurrent hash tables, the functions accessing the table with the chosen hashing algorithm need to be adapted for concurrency by adding a conflict resolution strategy. Such a strategy requires managing accesses in a way such that conflicts caused by them do not result in corrupt data, while ideally increasing their efficiency when used in parallel. Herlihy and Shavit[5] describe how the accesses to a hash table without such a strategy - in its example based on a basic implementation of the Cuckoo hashing algorithm - can be adapted for concurrent use. Fan et al.[6] further describe a table access scheme based on cuckoo hashing that is not only concurrent, but also keeps the space efficiency of its hashing function while also improving cache locality as well as the throughput of insertions.

When hash tables are not bound in size and are thus allowed to grow/shrink when necessary, the hashing algorithm needs to be adapted to allow this operation. This entails modifying the used hash function to reflect the new key-space of the resized table. A concurrent growing algorithm is described by Maier et al.[1]

Mega-KV[7] is a high performance key-value store system, where the cuckoo hashing is used and the KV indexing is massively parallelized in batch mode by GPU. With further optimizations of GPU acceleration by Nvidia and Oak Ridge National Lab, Mega-KV was pushed to another high record of the throughput in 2018 (up to 888 millions of key-value operations per second).[8]

Contention handling

[edit]
Concurrent accesses causing contention (marked in red).

As with any concurrent data structure, concurrent hash tables suffer from a variety of problems known in the field of concurrent computing as a result of contention.[3] Examples for such are the ABA problem, race conditions, and deadlocks. The extent in which these problems manifest or even occur at all depends on the implementation of the concurrent hash table; specifically which operations the table allows to be run concurrently, as well as its strategies for mitigating problems associated with contention. When handling contention, the main goal is the same as with any other concurrent data structure, namely ensuring correctness for every operation on the table. At the same time, it should naturally be done in such a way as to be more efficient than a sequential solution when used concurrently. This is also known as concurrency control.

Atomic instructions

[edit]

Using atomic instructions such as compare-and-swap or fetch-and-add, problems caused by contention can be reduced by ensuring that an access is completed before another access has the chance to interfere. Operations such as compare-and-swap often present limitations as to what size of data they can handle, meaning that the types of keys and values of a table have to be chosen or converted accordingly.[1]

Using so called Hardware Transactional Memory (HTM), table operations can be thought of much like database transactions,[3] ensuring atomicity. An example of HTM in practice are the Transactional Synchronization Extensions.

Locking

[edit]

With the help of locks, operations trying to concurrently access the table or values within it can be handled in a way that ensures correct behavior. This can however lead to negative performance impacts,[1][6] in particular when the locks used are too restrictive, thus blocking accesses that would otherwise not contend and could execute without causing any problems. Further considerations have to be made to avoid even more critical problems that threaten correctness, as with livelocks, deadlocks or starvation.[3]

Phase concurrency

[edit]
Concurrent accesses grouped into distinct phases.

A phase concurrent hash table groups accesses by creating phases in which only one type of operation is allowed (i.e. a pure write-phase), followed by a synchronization of the table state across all threads. A formally proven algorithm for this is given by Shun and Blelloch.[2]

Read-copy-update

[edit]

Widely used within the Linux kernel,[3] read-copy-update (RCU) is especially useful in cases where the number of reads far exceeds the number of writes.[4]

Applications

[edit]

Naturally, concurrent hash tables find application wherever sequential hash tables are useful. The advantage that concurrency delivers herein lies within the potential speedup of these use-cases, as well as the increased scalability.[1] Considering hardware such as multi-core processors that become increasingly more capable of concurrent computation, the importance of concurrent data structures within these applications grow steadily.[3]

Performance analysis

[edit]

Maier et al.[1] perform a thorough analysis on a variety of concurrent hash table implementations, giving insight into the effectiveness of each in different situations that are likely to occur in real use-cases. The most important findings can be summed up as the following:

Operation Contention Notes
Low High
find Very high speedups both when successful and unsuccessful unique finds, even with very high contention
insert High speedups reached, high contention becomes problematic when keys can hold more than one value (otherwise inserts are simply discarded if key already exists)
update Both overwrites and modifications of existing values reach high speedups when contention is kept low, otherwise performs worse than sequential
delete Phase concurrency reached highest scalability; Fully concurrent implementations where delete uses update with dummy-elements were closely behind

As expected low contention leads to positive behavior across every operation, whereas high contention becomes problematic when it comes to writing. The latter however is a problem of high contention in general, wherein the benefit of concurrent computation is negated due to the natural requirement for concurrency control restricting contending accesses. The resulting overhead causes worse performance than that of the ideal sequential version. In spite of this, concurrent hash tables still prove invaluable even in such high contention scenarios when observing that a well-designed implementation can still achieve very high speedups by leveraging the benefits of concurrency to read data concurrently.

However, real use-cases of concurrent hash tables are often not simply sequences of the same operation, but rather a mixture of multiple types. As such, when a mixture of insert and find operations is used the speedup and resulting usefulness of concurrent hash tables become more obvious, especially when observing find heavy workloads.

Ultimately the resulting performance of a concurrent hash table depends on a variety of factors based upon its desired application. When choosing the implementation, it is important to determine the necessary amount of generality, contention handling strategies and some thoughts on whether the size of the desired table can be determined in advance or a growing approach must be used instead.

Implementations

[edit]
  • .NET have ConcurrentDictionary,[9]
  • Since Java 1.5, concurrent hash maps are provided based upon concurrent map interface.[10]
  • libcuckoo provides concurrent hash tables for C/C++ allowing concurrent reads and writes. The library is available on GitHub.[11]
  • Threading Building Blocks provide concurrent unordered maps for C++ which allow concurrent insertion and traversal and are kept in a similar style to the C++11 std::unordered_map interface. Included within are the concurrent unordered multimaps, which allow multiple values to exist for the same key in a concurrent unordered map.[12] Additionally, concurrent hash maps are provided which build upon the concurrent unordered map and further allow concurrent erasure and contain built-in locking.[13]
  • growt provides concurrent growing hash tables for C++ on the basis of the so-called folklore implementation. Based on this non-growing implementation, a variety of different growing hash tables is given. These implementations allow for concurrent reads, inserts, updates (notably updating values based on the current value at the key) and removals (based upon updating using tombstones). Beyond that, variants on the basis of Intel TSX are provided. The library is available on GitHub.[1][14]
  • folly provides concurrent hash tables[15] for C++14 and later ensuring wait-free readers and lock-based, sharded writers. As stated on its GitHub page, this library provides useful functionality for Facebook.[16]
  • Junction provides several implementations of concurrent hash tables for C++ on the basis of atomic operations to ensure thread-safety for any given member function of the table. The library is available on GitHub.[17]

See also

[edit]

References

[edit]
  1. ^ a b c d e f g h i j k Maier, Tobias; Sanders, Peter; Dementiev, Roman (March 2019). "Concurrent Hash Tables: Fast and General(?)!". ACM Transactions on Parallel Computing. 5 (4). New York, NY, USA: ACM. Article 16. doi:10.1145/3309206. ISSN 2329-4949. S2CID 67870641.
  2. ^ a b c Shun, Julian; Blelloch, Guy E. (2014). "Phase-concurrent Hash Tables for Determinism". SPAA '14: Proceedings of the 26th ACM symposium on Parallelism in algorithms and architectures. New York: ACM. pp. 96–107. doi:10.1145/2612669.2612687. ISBN 978-1-4503-2821-0.
  3. ^ a b c d e f Li, Xiaozhou; Andersen, David G.; Kaminsky, Michael; Freedman, Michael J. (2014). "Algorithmic Improvements for Fast Concurrent Cuckoo Hashing". Proceedings of the Ninth European Conference on Computer Systems. EuroSys '14. New York: ACM. Article No. 27. doi:10.1145/2592798.2592820. ISBN 978-1-4503-2704-6.
  4. ^ a b Triplett, Josh; McKenney, Paul E.; Walpole, Jonathan (2011). "Resizable, Scalable, Concurrent Hash Tables via Relativistic Programming". USENIXATC'11: Proceedings of the 2011 USENIX conference on USENIX annual technical conference. Berkeley, CA: USENIX Association. p. 11.
  5. ^ Herlihy, Maurice; Shavit, Nir (2008). "Chapter 13: Concurrent Hashing and Natural Parallelism". The Art of Multiprocessor Programming. San Francisco, CA, USA: Morgan Kaufmann Publishers Inc. pp. 316–325. ISBN 978-0-12-370591-4.
  6. ^ a b Fan, Bin; Andersen, David G.; Kaminsky, Michael (2013). "MemC3: Compact and Concurrent MemCache with Dumber Caching and Smarter Hashing". nsdi'13: Proceedings of the 10th USENIX conference on Networked Systems Design and Implementation. Berkeley, CA: USENIX Association. pp. 371–384.
  7. ^ Zhang, Kai; Wang, Kaibo; Yuan, Yuan; Guo, Lei; Lee, Rubao; and Zhang, Xiaodong (2015). "Mega-KV: a case for GPUs to maximize the throughput of in-memory key-value stores". Proceedings of the VLDB Endowment, Vol. 8, No. 11, 2015.
  8. ^ Chu, Ching-Hsing; Potluri, Sreeram; Goswami, Anshuman; Venkata, Manjunath Gorentla; Imam, Neenaand; and Newburn, Chris J. (2018) "Designing High-performance in-memory key-value operations with persistent GPU kernels and OPENSHMEM"..
  9. ^ "ConcurrentDictionary Class (System.Collections.Concurrent)". learn.microsoft.com. Retrieved 26 November 2024.
  10. ^ Java ConcurrentHashMap documentation
  11. ^ GitHub repository for libcuckoo
  12. ^ Threading Building Blocks concurrent_unordered_map and concurrent_unordered_multimap documentation
  13. ^ Threading Building Blocks concurrent_hash_map documentation
  14. ^ GitHub repository for growt
  15. ^ GitHub page for implementation of concurrent hash maps in folly
  16. ^ GitHub repository for folly
  17. ^ GitHub repository for Junction

Further reading

[edit]
  • Herlihy, Maurice; Shavit, Nir (2008). "Chapter 13: Concurrent Hashing and Natural Parallelism". The Art of Multiprocessor Programming. San Francisco, CA, USA: Morgan Kaufmann Publishers Inc. pp. 299–328. ISBN 978-0-12-370591-4.
坐地户是什么意思 二月什么星座 知识渊博是什么意思 酸奶有什么营养价值 啵啵是什么意思
查宝宝五行八字缺什么 生花生吃了有什么好处 铜绿假单胞菌用什么抗生素 执业药师什么时候报名 昆明有什么特产
气管炎吃什么药 沙弗莱是什么宝石 宫缩是什么意思 蒲公英泡水喝有什么用 基围虾不能和什么一起吃
同型半胱氨酸是什么意思 桌游是什么 五大仙家什么仙最厉害 登高望远是什么生肖 疥疮是什么原因造成的
亿后面是什么单位hcv8jop7ns3r.cn 女人吃榴莲有什么好处hcv8jop3ns9r.cn 祛湿喝什么hcv7jop4ns5r.cn c肽高说明什么hcv8jop1ns1r.cn 雌二醇是什么hcv9jop5ns3r.cn
孕妇吃辣椒对胎儿有什么影响hcv9jop1ns2r.cn 梅花鹿吃什么食物hcv8jop3ns3r.cn 趋势是什么意思hcv8jop0ns3r.cn 青金石五行属什么hcv8jop2ns5r.cn 偏头痛挂什么科hcv9jop1ns3r.cn
上海副市长什么级别hcv9jop5ns9r.cn 嗜酸性粒细胞偏高是什么原因hcv7jop9ns5r.cn 小儿发烧吃什么食物好hcv8jop0ns8r.cn 营养土是什么土hcv8jop3ns4r.cn 山东登州府现在叫什么hcv7jop6ns5r.cn
为难的难是什么意思hcv9jop0ns3r.cn 嗓子苦是什么原因引起的hcv8jop5ns0r.cn 牵强是什么意思hcv7jop5ns4r.cn 什么是碱性磷酸酶高怎么回事hcv7jop9ns5r.cn 骑单车锻炼什么好处hcv9jop5ns1r.cn
百度