fix: queue Dealer sends and drain Transform SUB#311
Conversation
ccd9286 to
efd96c1
Compare
|
@claude Review this PR. |
|
Claude finished @from2001's task in 2m 23s —— View job PR Review: Queue Dealer Sends and Drain Transform SUBSummaryThis PR implements significant performance optimizations for the Unity NetSync client by addressing CPU spikes and thread safety issues. The changes are well-architected and follow good concurrency patterns. I've identified several critical issues that should be addressed before merging. Critical Issues1. Race Condition in
|
|
@claude I committed a new code for fixing your suggestions. Review the latest code. |
|
Claude finished @from2001's task in 1m 59s —— View job Review of Latest Code Changes ✅I've reviewed the latest commits addressing the previous critical issues. Here's my analysis: Critical Issues - Status✅ Issue #1: Race Condition in
|
Motivation
Deserializecalls on high-frequency Transform messages.DealerSocketis only touched from the network thread to eliminate a cross-thread send race that can cause hangs/crashes.Description
ConnectionManager:EnqueueTransformSend(latest-wins) andEnqueueReliableSend(FIFO) plus internal send queue structures andFlushOutgoingwhich is executed from the network thread and owns allDealerSocketsend calls (ConnectionManager.cs).Deserialize/process the last payload, and lowered the Transform SUBReceiveHighWatermarkto2(constantTransformRcvHwm) to prefer recent updates (ConnectionManager.cs).DealerSocketsends from main-thread components with enqueue calls:TransformSyncManagernow callsEnqueueTransformSend/EnqueueReliableSendfor stealth handshake and transform payloads,RPCManagersends RPCs viaEnqueueReliableSend, andNetworkVariableManagerroutes NV sends throughEnqueueReliableSend(updated files:TransformSyncManager.cs,RPCManager.cs,NetworkVariableManager.cs).ConnectionManager.cs).Testing
Codex Task
Close #302