125-java-concurrency

仓库创建 2025年2月9日最近提交 3 天前SkillHot 收录 21 天前
▸ 精选理由

优化并发模型与资源管理,提升稳定性与吞吐量。

这个 Skill 做什么

应用 Java 并发最佳实践,管理 Executor 与避免死锁、使用虚拟线程等。

在需要解决 Java 并发、线程安全或性能瓶颈时,给出基于 java.util.concurrent 的实战建议:线程安全要点、ExecutorService/线程池调优、Producer-Consumer、CompletableFuture 异步、虚拟线程与结构化并发等。适合审查代码、修 race condition 或选线程模型时使用,能帮你避免死锁、实现可取消性与回压。特别强调可观测性与现代 JVM 功能,提升可维护性。

▸ 展开 SKILL.md 英文原文

Use when you need to apply Java concurrency best practices — including thread safety fundamentals, ExecutorService thread pool management, concurrent design patterns like Producer-Consumer, asynchronous programming with CompletableFuture, immutability and safe publication, deadlock avoidance, virtual threads, structured concurrency, scoped values, backpressure, cancellation discipline, and observability for concurrent systems. This should trigger for requests such as Review Java code for concurrency; Review Java code for thread safety; Fix race conditions in Java concurrency code; Choose ExecutorService or virtual threads in Java; Improve synchronization and shared mutable state handling; Apply structured concurrency for related Java subtasks. Part of Plinth Toolkit

开发编程并发线程池性能通用
423
Stars
89
Forks
40
仓库内 Skill
+9
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/jabrena/plinth/main/skills/125-java-concurrency/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/jabrena/plinth/main/skills/125-java-concurrency/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Java rules for Concurrency objects

Identify and apply Java concurrency best practices to improve thread safety, scalability, and maintainability by using modern `java.util.concurrent` utilities and virtual threads.

**What is covered in this Skill?**

- Thread safety fundamentals: `ConcurrentHashMap`, `AtomicInteger`, `ReentrantLock`, `ReadWriteLock`, Java Memory Model
- `ExecutorService` thread pool configuration: sizing, keep-alive, bounded queues, rejection policies, graceful shutdown
- Producer-Consumer and Publish-Subscribe patterns with `BlockingQueue`
- `CompletableFuture` for non-blocking async composition (`thenApply`/`thenCompose`/`exceptionally`/`orTimeout`)
- Immutability and 
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有