-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dubbo support project loom #10768
Comments
随着JDK 19和 JEP 425的发布,是时候调研下dubbo如何支持project loom了。 loom对于上层的要求和建议,主要有几点(难度由低到高):
所以,这一块,我们至少可以分2步走: 目前进展
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.threadpool.ThreadPool;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_THREAD_NAME;
import static org.apache.dubbo.common.constants.CommonConstants.THREAD_NAME_KEY;
public class VirtualThreadPool implements ThreadPool {
@Override
public Executor getExecutor(URL url) {
String name = url.getParameter(THREAD_NAME_KEY,
(String) url.getAttribute(THREAD_NAME_KEY, DEFAULT_THREAD_NAME)
);
ThreadFactory factory = Thread.ofVirtual().name(name).factory();
return Executors.newThreadPerTaskExecutor(factory);
}
}
最终的stack:
|
Is this issue closed by #13111? |
Yep |
Describe the proposal
The text was updated successfully, but these errors were encountered: