简体   繁体   中英

uint64_t writes in 32 bit machine

When 2 process communicating via shared memory on 32 bit solaris i386 Arch

  1. Is it guaranteed that for the value of uint64_t datatype, ( value < 2^32 ) is written in single memory location and ( value > 2^32 ) is written in 2 memory location?
  2. Is the 32 bit memory read is atomic.?

A 64-bit value is always written into 64 bits of memory! 1 The write is almost certainly not atomic (unless the architecture explicitly guarantees this).


1. Except, of course, when it's not written to memory at all (ie when there's no register spill . But that's beside the point.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM