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

Fix zenoh-c DLL crash in libc::atexit handler #970

Closed

Conversation

fuzzypixelz
Copy link
Member

@fuzzypixelz fuzzypixelz commented Apr 25, 2024

Tries to fix #973.

If I understand correctly, the reason for using threads here is to optimize the destructor, but the cost of spawning threads is usually too high. I tried to measure the execution time of this destructor and got 400µs. If we use one thread to shutdown all runtimes this actually drops (pun intended) down to 20µs. And it resolves the above panic. This is what the pull request does, in addition to decreasing the shutdown timeout to 1ms. The shutdown threads are used because one supposedly cannot call shutdown_timeout() from the same thread that was used to create the runtime.

@fuzzypixelz
Copy link
Member Author

Closed in favor of #981.

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

Successfully merging this pull request may close these issues.

zenoh-c DLL panics in libc::atexit handler on Windows
1 participant