Skip to content
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

What does the defaultEventExecutorGroup in NettyClientBootstrap do? #6132

Open
PleaseGiveMeTheCoke opened this issue Dec 11, 2023 · 2 comments

Comments

@PleaseGiveMeTheCoke
Copy link
Contributor

defaultEventExecutorGroup在NettyClientBootstrap的start方法中被开启。

    public void start() {
        if (this.defaultEventExecutorGroup == null) {
            this.defaultEventExecutorGroup = new DefaultEventExecutorGroup(nettyClientConfig.getClientWorkerThreads(),
                new NamedThreadFactory(getThreadPrefix(nettyClientConfig.getClientWorkerThreadPrefix()),
                    nettyClientConfig.getClientWorkerThreads()));
        }
        // ......
    }

根据它的命名NettyClientWorkerThread,它是一个worker线程组,但是我并没有发现使用到该线程组的地方。

    String DEFAULT_SELECTOR_THREAD_PREFIX = "NettyClientSelector";
    String DEFAULT_WORKER_THREAD_PREFIX = "NettyClientWorkerThread";

这是不是意味着开启了一个占用系统资源但没什么用处的线程组?


defaultEventExecutorGroup is enabled in the startup method of NettyClientBootstrap.

    public void start() {
        if (this.defaultEventExecutorGroup == null) {
            this.defaultEventExecutorGroup = new DefaultEventExecutorGroup(nettyClientConfig.getClientWorkerThreads(),
                new NamedThreadFactory(getThreadPrefix(nettyClientConfig.getClientWorkerThreadPrefix()),
                    nettyClientConfig.getClientWorkerThreads()));
        }
        // ......
    }

According to its naming NettyClientWorkerThread, it is a Worker thread group, but I didn't find any use for that thread group.

    String DEFAULT_SELECTOR_THREAD_PREFIX = "NettyClientSelector";
    String DEFAULT_WORKER_THREAD_PREFIX = "NettyClientWorkerThread";

Does this mean that a thread group is opened that takes up system resources but is of little use?

@funky-eyes
Copy link
Contributor

我认为它确实是一个无用的线程池
I think it's really a useless thread pool

@PleaseGiveMeTheCoke
Copy link
Contributor Author

我认为它确实是一个无用的线程池 I think it's really a useless thread pool

How about I submit a PR to delete this thread pool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants