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

Is rosconsole thread safe? #60

Open
qlibp opened this issue Aug 7, 2023 · 0 comments
Open

Is rosconsole thread safe? #60

qlibp opened this issue Aug 7, 2023 · 0 comments

Comments

@qlibp
Copy link

qlibp commented Aug 7, 2023

As I skim throw the code, I got that we don't have read-lock when performing logs.

This operation is safe if we don't dynamically change the log level at runtime via checkLogLocationEnabledNoLock(). But if we do, we have no read-lock to synchronize the logger_enabled_ flag.

The reason to do this, I guess, is that even if the flag is not synchronized, the few missing logs is not a problem, compared to the performance hurt with read-lock on every log. Could you guys elaborate more in detail?

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