The chat regenerate/trash button handling had a monolithic lock that blocked the worker thread during token counting. The token counting is performed by calling TracyLlmApi::Tokenize(), which issues a blocking HTTP POST request to the LLM API - on the UI thread. To avoid blocking both the worker and freezing the UI during HTTP calls, the lock was split into m_jobsLock and m_chatLock. However, this introduced a race condition. For the assistant role (regenerate message action), the code: 1. Stops the current job and queues a new one (under m_jobsLock) 2. Releases the lock 3. Performs token counting via HTTP calls (no lock held) 4. Re-acquires m_jobsLock and stops m_currentJob again Between steps 2 and 4, the worker thread can complete the old job and pick up the newly queued job. The stop at step 4 then incorrectly stops the new regenerate job instead of the old one. Under the original monolithic lock, the worker couldn't access m_currentJob until after step 4, so the stop always applied to the correct job. After the split, the second stop became harmful for the assistant case. The fix makes the second stop conditional on user role only (thrash action), since that's the case where no new job is queued and we genuinely need to stop any running generation before the user edits their message.
Tracy Profiler
A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.
Tracy supports profiling CPU (Direct support is provided for C, C++, Lua, Python and Fortran integration. At the same time, third-party bindings to many other languages exist on the internet, such as Rust, Zig, C#, OCaml, Odin, etc.), GPU (All major graphic APIs: OpenGL, Vulkan, Direct3D 11/12, Metal, OpenCL, CUDA.), memory allocations, locks, context switches, automatically attribute screenshots to captured frames, and much more.
- Documentation for usage and build process instructions
- Releases containing the documentation (
tracy.pdf) and compiled Windows x64 binaries (Tracy-<version>.7z) as assets - Changelog
- Interactive demo
An Introduction to Tracy Profiler in C++ - Marcos Slomp - CppCon 2023
Introduction to Tracy Profiler v0.2
New features in Tracy Profiler v0.3
New features in Tracy Profiler v0.4
New features in Tracy Profiler v0.5
New features in Tracy Profiler v0.6
New features in Tracy Profiler v0.7
New features in Tracy Profiler v0.8



