Monday, July 22, 2024

JVM

Each JVM is thread-safe.
Thread safety allows multiple JVMs to share system resources, such as memory allocation, on a uniprocessor.
Thread safety uses an atomic instruction to synchronize those processes on a uniprocessor.
To synchronize those processes on a multiprocessor requires coherence.

Paradox:
Multiple simultaneous processes on different processors create a data race.
Think of coherence as a processor race to invalidation.
Thread safety resolves any data race. So why coherence?
 
Why Coherence?
The current implementation of the atomic instruction is not thread-safe.
Currently all instructions execute in the cache.
The swap occurs in the cache and the caches require coherence.
If the swap bypasses the cache and occurs in main memory then, with some additional changes, coherence vanishes. If you bypass the cache, there is no cache coherence.

This is why infinite JVMs can execute concurrently, but multiprocessors are limited to 4.
Because JVMs are thread-safe but current hardware is not.

No comments:

Post a Comment

Thread Safe Computers

  The invention redefines thread safe.  For comparison, two current definitions are shown below. Due to blog incompatibility current version...