Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU usage at get_local_thread_context, any sugesstions to find out the problem? #635

Open
tqolf opened this issue Dec 20, 2024 · 1 comment

Comments

@tqolf
Copy link

tqolf commented Dec 20, 2024

servel threads CPU usage reached 100% at get_local_thread_context, but no log outputs. all log is >=Debug, and log level is set to Debug too.

it looks like there is dead loop, but no ideas to find it out currently. and no other prominent methods

@odygrd
Copy link
Owner

odygrd commented Dec 20, 2024

I am not sure i understand the issue, do you mean it just had high usage for a while or got stuck ? It does use a spinlock underneath when adding a new thread for the first time

_new_thread_context_flag.store(true, std::memory_order_release);

Also it only runs once on the first log statement for the thread issuing it and caches the result

thread_context = detail::get_local_thread_context<frontend_options_t>();

you can reduce the time it takes by calling this each time when you spawn a new thread from within the new thread

QUILL_ATTRIBUTE_COLD static void preallocate()

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

No branches or pull requests

2 participants