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

vroom 1.14.0 osx build failure due to jthread #1062

Open
chenrui333 opened this issue Jan 16, 2024 · 3 comments
Open

vroom 1.14.0 osx build failure due to jthread #1062

chenrui333 opened this issue Jan 16, 2024 · 3 comments

Comments

@chenrui333
Copy link

Apple clang MacOS does not accept yet jthread C++ 20 extension (see https://en.cppreference.com/w/cpp/compiler_support/20), while vroom uses it. Thus vroom does not compile with Apple clang.

One solution is to follow rule CP.4 of CppCoreGuidelines: "Think in terms of tasks, rather than threads". Thus, vroom should prefer std::async to std::jthread.

@jcoupey
Copy link
Collaborator

jcoupey commented Jan 17, 2024

The use of std::jthread over std::thread was introduced in 02eb40b as part of a refactoring based on the sonarcloud static analysis recommendations. A quick fix for anyone needing to build using Apple clang would be to simply git revert 02eb40b4e (works out of the box on the release branch).

Thanks for pointing out the recommendation in the core guidelines. I have virtually no knowledge of std::async but I can see the benefit of using a higher-level abstraction. So happy to look at options for this kind of replacement. The only potential concern would be to know whether we can still tune the number of underlying threads that are used. Not only do we do it currently, but we allow users to decide on that parameter with the -t option.

@chenrui333
Copy link
Author

Cool, cool, I will just revert that commit to my homebrew PR. Thanks for the pointer!

@jcoupey
Copy link
Collaborator

jcoupey commented May 22, 2024

What is the status here? Looks like the downstream PR Homebrew/homebrew-core#160054 has been closed, shall we close this ticket too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants