Skip to content

【Enhancement】优化主流程lookProcessChain方法 issue #3513#3592

Open
LilMosey wants to merge 9 commits into
alibaba:1.8from
LilMosey:feat/enhancer/ctsph/lookProcessChain
Open

【Enhancement】优化主流程lookProcessChain方法 issue #3513#3592
LilMosey wants to merge 9 commits into
alibaba:1.8from
LilMosey:feat/enhancer/ctsph/lookProcessChain

Conversation

@LilMosey

Copy link
Copy Markdown

Describe what this PR does / why we need it

issue #3513
(详细信息都在issue里)

Does this pull request fix one issue?

issue #3513

Describe how you did it

image

Describe how to verify it

实现逻辑参照Collections.synchronizedMap()
image

原逻辑做了一次copyOnWrite操作,加锁后其实没必要进行copyOnWrite造成了资源浪费增加gc压力

Special notes for reviews

@CLAassistant

CLAassistant commented Jan 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@LilMosey LilMosey changed the title issue #3513 【Enhancement】优化主流程lookProcessChain方法 issue #3513 Jan 21, 2026
@LilMosey

Copy link
Copy Markdown
Author

@LearningGp 大佬能帮忙review一下吗?去年提过一次pr,但是当时用的是master分支

LilMosey added 8 commits July 14, 2026 20:33
… 并发执行的场景。现有 double-check 可以修复临时读取为 null 的情况,但无法保证非空 ProcessorSlotChain 及其内部 slot 链被安全发布。ConcurrentHashMap 的非空读取与对应写入之间具备 happens-before,同时 get 不需要加互斥锁。现有同步块继续负责防止重复创建、精确控制 6000 容量上限,并保护 SlotChainProvider.newSlotChain()。这样既避免原 Copy-on-Write 每次新增资源都复制整张 Map 的 CPU 和 GC 开销,也保留了并发正确性。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants