From 6bd4ea17108b2e959ed25a390fa3a740b173c157 Mon Sep 17 00:00:00 2001 From: viktorklang Date: Wed, 18 Apr 2012 12:46:58 +0300 Subject: [PATCH] Clarifying actor jmm rules --- akka-docs/general/jmm.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/akka-docs/general/jmm.rst b/akka-docs/general/jmm.rst index 3fe94d89db..6d088c0c47 100644 --- a/akka-docs/general/jmm.rst +++ b/akka-docs/general/jmm.rst @@ -43,6 +43,12 @@ To prevent visibility and reordering problems on actors, Akka guarantees the fol * **The actor send rule:** the send of the message to an actor happens before the receive of that message by the same actor. * **The actor subsequent processing rule:** processing of one message happens before processing of the next message by the same actor. +.. note:: + + In layman's terms this means that changes to internal fields of the actor is visible when the next message + is processed by that actor. So fields in your actor does not need to be volatile or equivalent. + + Both rules only apply for the same actor instance and are not valid if different actors are used. Futures and the Java Memory Model