# Lock Striping

DevFeed: [Lock Striping](<https://devfeed.tech/articles/lock-striping-24834.md>)

Original publisher: [Read original article](<https://alidg.me/blog/2020/1/11/lock-striping>)

Author: Alimate

Published: 2020-01-11T00:00:00Z

Content type: article

Language: en

Sources: [Ali Dehghan - Kemikit](<https://devfeed.tech/sources/ali-dehghan-kemikit.md>)

Topics: [synchronization](<https://devfeed.tech/topics/synchronization.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [thread safe data sharing](<https://devfeed.tech/topics/thread-safe-data-sharing.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>)

Tags: [concurrent](<https://devfeed.tech/tags/concurrent.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [lock](<https://devfeed.tech/tags/lock.md>), [lock-free](<https://devfeed.tech/tags/lock-free.md>), [locks](<https://devfeed.tech/tags/locks.md>), [map](<https://devfeed.tech/tags/map.md>), [performance](<https://devfeed.tech/tags/performance.md>)

## AI overview

The excerpt describes a thread-safe hashtable built with ordinary locks, contrasting its approach with lock-free designs based on CAS. In the coarse-grained version, one lock enforces exclusive access for all operations. The map starts with a fixed number of buckets, selects a bucket using the key's hash modulo the bucket count, and inserts or updates entries. To address performance degradation as stored elements outgrow the buckets, it proposes resizing when an average bucket-size threshold is exceeded; resizing requires copying the current table. The excerpt does not provide the completed resize implementation or results comparing coarse- and fine-grained synchronization.

## Source excerpt

Let's see how well a fine-grained synchronized concurrent data structure performs compared to its coarse-grained counterpart