Partial Sharing
We have previously encountered the two opposite extremes of resource sharing: the publicly shared resource pool and the thread-private instance of a resource. Between these two extremes lie the sharing middleground of the partial-sharing resource pool.
When each thread requires a single instance of a resource, you can easily eliminate contention by making it thread-private. If the required number of instances cannot be determined in advance, you need to use a resource pool that is shared among all threads. Such shared resources often become a contention hot spot among threads, which severely degrades performance and scalability. Threads spend significant cycles spinning idle. Partial-sharing of resource pools offers a way out ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access