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

Why change to using cpp standard thread id instead of native os thread id? #1112

Open
kuntryn opened this issue Jul 8, 2024 · 1 comment

Comments

@kuntryn
Copy link

kuntryn commented Jul 8, 2024

#1019
The thread id in log was changed to using cpp standard thread id starting from version 0.7.0. However, because the thread id of the standard library cannot be mapped to thread id of the operating system easily, it is less helpful when debugging, especially when used in combination with commands such as ps and top.

@sergiud
Copy link
Collaborator

sergiud commented Jul 8, 2024

As we switched to C++14 the goal was to eliminate platform specific boilerplate code. While your use case is probably valid, most of the users will be using standard threads which is the only well-defined approach to concurrency in C++. Also, with debuggers it is straightforward to identify the corresponding thread without any conversion.

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