133tosakarin
133tosakarin
hello, I'm a beginer, Can I choose this issue ?
@szetszwo please take a look. If you agree to write it this way, I will create an issue in jira.
@szetszwo @OneSizeFitsQuorum Please check the comments below. could you help me refer to which one to use as the final solution? There are currently two main options: 1. Move future.join...
> @133tosakarin , thanks a lot for working on this! The idea is great. > > * We should avoid using `Optional`. Using `final` is better since the compiler will...
> Suppose we have the following code: > > ```java > synchronized(server) { > ... > final CompletableFuture future = state.shudown() > f.join() > } > ``` > > *...
> * Version 1 > > ```java > synchronized (server) { > future = state.shutdown(); > while (!future.isDone()) { > server.wait(); > } > } > ``` > > ```java...
> > For version 2, the current thread and the thread that needs to be shut down may execute in parallel. > > No. `future.join()` means that it is waiting...
Consider a real-world scenario: The leader, while executing **synchronized changeToFollower(...)**, calls future.join() to wait for all logAppender tasks to complete. However, at that moment, the logAppender might already be blocked,...
> > ... . Even if we release the lock held at the changeToFollower level, the upper-layer locks are still in place. ... > > This is a good. We...