Skip to content

Document Safety on _unsynchronized functions #714

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

Open
m-mueller678 opened this issue May 28, 2025 · 0 comments
Open

Document Safety on _unsynchronized functions #714

m-mueller678 opened this issue May 28, 2025 · 0 comments

Comments

@m-mueller678
Copy link

The documentation on *_unsynchronized functions states that they are unsafe because they are 'unsynchronized'. However, they do not state what kind of synchronization the caller is expected to perform. Looking at the implementations of the safe variants, it seems that they all acquire a global lock. It is not obvious to me why this is necessary. See also #637, which appear to argue that it is not?

If locking is necessary, then I think this locking behavior should be documented on the safe functions, as it is a significant performance pitfall. I get that the main focus of this crate is to help with error diagnostics, where performance is probably not super important. I was planning to use it to implement a sampling profiler for bare-metal environments, and this would be pretty important to know.

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

1 participant