GOARCH=amd64
If it's 64-bit size, is a global pointer value 8-byte aligned in memory so that a read or write operation of that pointer value is carried out atomically?
For example, in the following code, is it possible that the global pointer p is only partially updated when the read goroutine read the pointer?
var p *int
void main() {
i := 1
p = &i
go func() {
fmt.Println(*p)
}()
}
The scenario I'm concerning is that there is only one write but multiple reads on a global pointer value, and reading of an old value of the pointer is not important. Thanks in advance!