4 ms·
Symbolics tried that. Scary thought: how many bytes of RAM are there in the world? Probably more than 2^64. There are around 7 billion smartphones, and many ha
by Animats 5y ago
Symbolics tried that.
Scary thought: how many bytes of RAM are there in the world? Probably more than 2^64. There are around 7 billion smartphones, and many have over 4GB of memory. That's over 2^64 right there.
I'd like to have 128-bit atomic operations. If you're doing lock-free programming, hardware compare and swap on a structure that contains two pointers is useful. Then you can update lists atomically. In a 64-bit pointer machine, that takes 128 bit atomics. So far, not much hardware offers that.
- Dylan16807 5y agoCMPXCHG16B has been standard for the vast majority of the time x86_64 has existed. If a CPU can run windows 8.1, then it has 128-bit atomic operations.
- Animats 5y agoRust does not have AtomicU128, for some reason. Need to look into that.
- Dylan16807 5y agohttps://internals.rust-lang.org/t/is-atomicu128-gone-for-good/15657 https://internals.rust-lang.org/t/is-atomicu128-gone-for-goo... https://ebarnard.github.io/2019-06-03-rust-smaller-trait-implementers-docs/core/sync/atomic/struct.AtomicU128.html https://ebarnard.github.io/2019-06-03-rust-smaller-trait-imp... https://github.com/rust-lang/rust/issues/32976 https://github.com/rust-lang/rust/issues/32976 A little confusing but it looks like you can get to it.
- Animats 5y agoAh. There are still some AMD64 CPUs out there that don't have cmpxchg16b capability. The Linux developers made the decision to not use cmpxchg16b and continue supporting them. Microsoft made the decision to use cmpxchg16b for Windows 8 and later. There are some libraries which probe on first use and either use cmpxchg16b or use a global lock. That's probably a viable strategy at this point, since CPUs without it are now rare. But I can see the argument against it. [1] https://superuser.com/questions/187254/how-prevalent-are-old-x64-processors-lacking-the-cmpxchg16b-instruction https://superuser.com/questions/187254/how-prevalent-are-old...
- monocasa 5y agoSymbolics maxed out at 40-bit pointers.
- Animats 5y agoThere was some kind of scheme for accessing objects on other machines over the local network using a very long memory address, but I don't know if it was ever used.