On Mon, 20 Sep 2021 17:47:18 GMT, Alexey Ivanov <[email protected]> wrote:

>> So I guess the question is whether there is a valid transitory failure use 
>> case?
>
>> The difference is that Holder will fail that way forever, while the DLC have 
>> a chance to resurrect on next call.
> 
> Is it really possible that next call will succeed after the previous one 
> failed with an exception?

It may fail when one thread got OOM, but later another/this one will work fine. 
We can use a holder if there will be some real benefits from using it, but DCL 
is just simpler and safer in this particular case.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5517

Reply via email to