G
graftonfot
From what I understand, Java guarantees that all assignments to
primitive types (except non-volatile 64-bit types) will be atomic.
How does it do this? I thought that the only truly uninterruptable
processor instruction was the test-and-set, and that test-and-set was
the basis from which richer thread synchronization resources typically
provided by an underlying operating system (e.g. semaphores, mutexes,
critical sections) were built.
Does Java internally implement all of its generated assignment opcodes
inside some kind of test-and-set-based wrappers?
Thanks.
primitive types (except non-volatile 64-bit types) will be atomic.
How does it do this? I thought that the only truly uninterruptable
processor instruction was the test-and-set, and that test-and-set was
the basis from which richer thread synchronization resources typically
provided by an underlying operating system (e.g. semaphores, mutexes,
critical sections) were built.
Does Java internally implement all of its generated assignment opcodes
inside some kind of test-and-set-based wrappers?
Thanks.