ams
ams

Reputation: 62732

Are JVM languages bound by the Java Memory Model or just the Java Programming Language?

Is the memory model for Java a feature of the Java Programming Language or a feature of the JVM? Are JVM languages bound by the Java Memory Model or just The Java Programming Language?

Upvotes: 3

Views: 219

Answers (2)

Joachim Sauer
Joachim Sauer

Reputation: 308239

Strictly speaking the Java Memory Model is part of the Java Language Specification as opposed to the Java Virtual Machine Specification. However, the JVM Spec depends heavily on the JLS to specify details of the operation and the Java Memory Model applies to every bytecode executed, no matter which language it was originally compiled from. Therefore all JVM languages are bound to it (or benefit from it, depending on how you look at it).

Upvotes: 8

T.J. Crowder
T.J. Crowder

Reputation: 1075337

The memory model applies across the JVM, regardless of the source language in which the bytecode was written. By the time it's bytecode, it's bytecode.

Upvotes: 4

Related Questions