|
|
Subscribe / Log in / New account

An introduction to lockless algorithms

An introduction to lockless algorithms

Posted Feb 21, 2021 12:38 UTC (Sun) by ale2018 (guest, #128727)
Parent article: An introduction to lockless algorithms

> thread 2 will read either NULL or &a,

If pointers are 64 bit, does that statement imply that the cache is being updated by minimal chunks of that size? I mean, why cannot it read the lower part of &a?


to post comments

An introduction to lockless algorithms

Posted Feb 21, 2021 12:53 UTC (Sun) by pbonzini (subscriber, #60935) [Link]

Generally it's up to the architecture to define the largest size that can be stored atomically. It's almost always (on a modern 32-bit or 64-bit processor) at least the size of a pointer.

The processor itself will load data from memory in cache lines that will usually be 32, 64 or 128 *bytes* long.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds