seata What does the defaultEventExecutorGroup in NettyClientBootstrap do?

ecfdbz9o  于 4个月前  发布在  Bootstrap
关注(0)|答案(2)|浏览(104)

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?

rjee0c15

rjee0c151#

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

bvhaajcl

bvhaajcl2#

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

How about I submit a PR to delete this thread pool

相关问题