018de94dc3ee7f8f2fc21242d39701f9fd6ba336
PROBLEM: HumanizationConfig used std::mutex which blocked ALL readers when ANY read was happening. With 100+ concurrent bots calling GetActivityConfig() and GetHourlyActivityMultiplier() from ThreadPool workers, this caused severe lock contention and task delays. SOLUTION: 1. Changed std::mutex to std::shared_mutex for read-heavy access 2. Use std::unique_lock only during Load()/Reload() (rare operation) 3. Use std::shared_lock for GetActivityConfig() (multiple readers OK) 4. Made GetHourlyActivityMultiplier() lock-free since _hourlyMultipliers is set once during Load() and never modified at runtime 5. Changed C-array to std::array<float, 24> for better type safety This eliminates a major ThreadPool bottleneck where every bot's HumanizationManager::Update() was blocking on mutex acquisition. Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: luis <[email protected]>
WowCommunityProject
Blizzlike WowCommunity project
Languages
C++
89.3%
C
10.1%
CMake
0.4%