From ea8806b7f920ec6cdde742c0e546908be589e739 Mon Sep 17 00:00:00 2001 From: TestingPlant <44930139+TestingPlant@users.noreply.github.com> Date: Sun, 9 Mar 2025 02:45:10 +0000 Subject: [PATCH] fix: do not multithread ChatMessage processing Chat messages must be processed before the packet bump allocator is cleared because they store a reference to the packet data. In other words, we need a happens-before relationship where chat message processing happens before the packet bump allocator is cleared. Disabling multithreaded ChatMessage processing is one way of providing this happens-before relationship, and since processing chat messages is relatively cheap, this should not cause any noticable performance problems. --- events/tag/src/module/chat.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/events/tag/src/module/chat.rs b/events/tag/src/module/chat.rs index aea77baa..dc81ddef 100644 --- a/events/tag/src/module/chat.rs +++ b/events/tag/src/module/chat.rs @@ -36,7 +36,6 @@ impl Module for ChatModule { .add_trait::<(flecs::With, ChatCooldown)>(); system!("handle_chat_messages", world, &mut EventQueue($), &hyperion::net::Compose($)) - .multi_threaded() .each_iter(move |it: TableIter<'_, false>, _: usize, (event_queue, compose): (&mut EventQueue, &hyperion::net::Compose)| { let world = it.world(); let span = info_span!("handle_chat_messages");