HMCL-dev / HMCL-dev/HMCL

[Feature] 重构模组读取的线程模型

Open
#6,568 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
10.1k
Forks
934
Avg merge
1d 5h
Merged PRs (30d)
82

Description

概述 | Summary

重新梳理 HMCL 读取模组内容时的线程模型,用 每实例单写执行器 + UI 消费不可变快照 替代当前散落各处的 ReentrantLock / ConcurrentHashMap / volatile,使 ModManager 回到单线程的干净状态。

原因 | Reason

在 #6230 的 review 中,Glavo 指出:

感觉这个 PR 实现的很奇怪。我们可能需要先好好思考一下 HMCL 读取这些内容时的线程模型,而不是像这个 PR 搞得到处是锁,到处上 ConcurrentHashMap

详情 | Description

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by tracing ModManager and the module-reading paths, then read the threading discussion in #6230. Done means the existing scattered locking and concurrent state are replaced by the specified per-instance single-writer model with immutable snapshots consumed by the UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.