alibaba / alibaba/p3c

只需要一个线程时能不能手动显式创建

Open
#762 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
30.8k
Forks
8k
PR merge metrics
No merged PRs in 30d

Description

## 规约原文
【强制】线程资源必须通过线程池提供,不允许在应用中自行显式创建线程。
## 问题描述
当程序中确定只会创建一个线程的时候,比如创建一个线程专门用来接收消息队列的消息,这种情况直接用 new Thread() 可以吗?还是需要创建一个线程池?
如果写new Thread(),插件会警告。如果创建线程池,感觉没必要。

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the quoted thread-resource rule and the question about using new Thread() for a single message-queue consumer. Check the existing rule guidance and comment discussion, then document whether the rule permits this case or requires a thread pool. Done means the exception or requirement is stated unambiguously for users.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.