-
Notifications
You must be signed in to change notification settings - Fork 50
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
support BOOST_URL_DISABLE_THREADS #689
support BOOST_URL_DISABLE_THREADS #689
Conversation
7980657
to
a50a01a
Compare
Where do we detect single-threaded toolchains? The user has to set this manually? |
@ropieur could you try this branch? This implementation uses |
GCOVR code coverage report https://689.url.prtest.cppalliance.org/gcovr/index.html |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #689 +/- ##
===========================================
- Coverage 97.13% 97.12% -0.02%
===========================================
Files 152 152
Lines 8441 8445 +4
===========================================
+ Hits 8199 8202 +3
- Misses 242 243 +1
Continue to review full report at Codecov.
|
@sdarwin any ideas to improve that? |
std::lock_guard< | ||
std::mutex> m(all_reports_.m); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just make count
and bytes
atomic instead of using a mutex.
@@ -90,8 +90,14 @@ class recycled | |||
{ | |||
T t; | |||
U* next = nullptr; | |||
|
|||
#if !defined(BOOST_URL_DISABLE_THREADS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary. Single threaded C++11 platforms have a working <atomic>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<atomic>
a50a01a
to
ce8dfeb
Compare
GCOVR code coverage report https://689.url.prtest.cppalliance.org/gcovr/index.html |
ce8dfeb
to
58ed304
Compare
GCOVR code coverage report https://689.url.prtest.cppalliance.org/gcovr/index.html |
old_count_max, new_count)) | ||
{} | ||
|
||
std::size_t new_bytes = a.bytes.fetch_add(n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetch_add returns the old value, not the new one. a.bytes += n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This?
I will have to check internally with my colleagues how we can proceed next week when I am back at work, because we are building boost as a 3rdparty all at once. This will require from us to merge your changes with boost 1.81.0 and tweak our building procedure. I'll keep you posted. |
fix #684