jvz commented on PR #1195:
URL: https://github.com/apache/logging-log4j2/pull/1195#issuecomment-1379238383

   I've realized recently that this class could use some better internal docs. 
I had to chase a lot of academic pointers to find out what the hell 
release/acquire memory ordering semantics means since the `VarHandle` API docs 
essentially tell you that "it works basically the same way as some feature in C 
and C++" which itself is a fairly recent addition to those language standards 
(C11 and C++11, though of course prior versions had non-standard extensions in 
various compilers to support similar features since they're relevant to 
implementing multithreaded runtimes). I hope that the API docs are sufficiently 
clear, though, on the reasoning behind using `Lazy::lazy` (the "strict" lazy) 
versus `Lazy::relaxed` (the "ok to compute multiple times as long as we all get 
the same published reference in the end" lazy) versus the other one (the "ok to 
compute multiple times as we always get the same result, so any thread can have 
any published value" lazy). Kotlin's own lazy class supports less
  than this, but they don't seem to use Java 11 yet.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to