Skip to content

Conversation

@AlexGuteniev
Copy link
Contributor

@AlexGuteniev AlexGuteniev commented Aug 4, 2020

Resolves #680

AlexGuteniev and others added 30 commits March 17, 2020 13:55
Don't consume _CRT_SATELLITE_1, it is not ours
# Conflicts:
#	tests/std/test.lst
Co-Authored-By: Stephan T. Lavavej <stl@nuwen.net>
yes, non-specific

Co-Authored-By: Stephan T. Lavavej <stl@nuwen.net>
Also constexpr atomic initializers
Co-authored-by: Billy O'Neal <bion@microsoft.com>
Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving despite a desire to not mention the optimization manual to dismiss my waiting status.

@StephanTLavavej StephanTLavavej removed the bug Something isn't working label Aug 18, 2020
@cbezault
Copy link
Contributor

I've finally heard back from Intel concerning the code snippet from the manual. The code in the manual is licensed under the 0BSD license. This means we don't need to provide any attribution, license, or copyright text. Our lawyers have suggested just keeping the comment text as-is, additionally noting the 0BSD license (nothing formal is needed).

@cbezault cbezault removed their assignment Jan 19, 2021
@StephanTLavavej StephanTLavavej removed the blocked Something is preventing work on this label Jan 19, 2021
@AlexGuteniev
Copy link
Contributor Author

Updated. There's still GH-1197

Copy link
Contributor

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've "requested changes" here which I'll apply myself after the fix for GH-1197 is applied internally (intrin.h and intrin0.h are part of vcruntime which is not yet opensource).

@CaseyCarter CaseyCarter self-assigned this Jan 20, 2021
Copy link
Contributor

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed a change to (1) define _mm_pause directly in xatomic.h during the transition until the vcruntime change to intrin0.h goes live, and (2) Do The Right Thing in ARM64EC mode.

@AlexGuteniev
Copy link
Contributor Author

I see that everything looks complete now

@CaseyCarter CaseyCarter removed their assignment Jan 21, 2021
@CaseyCarter
Copy link
Contributor

I see that everything looks complete now

Thanks for the reminder: I've resolved all open comments and moved this back to Final Review.

// Example 2-4. Contended Locks with Increasing Back-off Example - Improved Version, page 2-22
// The code in mentioned manual is covered by the 0BSD license.
int _Current_backoff = 1;
const int _Max_backoff = 64;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I observe that this could be constexpr but it doesn't make a difference - no change requested.

// timing assumption that the main thread evaluates the `wait(old_value)` before this timeout expires
std::this_thread::sleep_for(waiting_duration);
add_seq('6');
#endif // CAN_FAIL_ON_TIMING_ASSUMPTION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this is being removed (more than 1 line is guarded) but as there are no nearby preprocessor guards, no change requested.

@StephanTLavavej StephanTLavavej self-assigned this Jan 26, 2021
@StephanTLavavej StephanTLavavej merged commit 3d7a01c into microsoft:master Jan 26, 2021
@AlexGuteniev AlexGuteniev deleted the yield branch January 26, 2021 07:49
@StephanTLavavej
Copy link
Member

Thanks for this performance improvement! This PR went through quite a pause but it should be worth the wait. ⏸️ 😹

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

Labels

performance Must go faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<xatomic.h>: Consider adding _mm_pause on x86/x64

5 participants