alibaba / alibaba/p3c

不允许在方法内部创建线程池

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

Description

## Rule content
.【强制】线程资源必须通过线程池提供,不允许在应用中自行显式创建线程,不允许在方法内部创建线程池。

## Problem description
在方法内部创建线程池等同于在应用中自行创建线程,在并发情况下,有可能造成系统创建大量同类线程面导致消耗内存或者“过度切换”的问题,也容易出现线程池不正确shutdown。

## Advice

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no source file, test, or entry point. Start by locating the rule that checks thread creation and its existing tests, then verify how method-local thread-pool creation is represented. Done means the prohibited pattern is detected without permitting application-managed thread pools outside methods, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.