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

x/sys/windows: Expose timeBeginPeriod and timeEndPeriod #61723

Closed
johnrs opened this issue Aug 2, 2023 · 5 comments
Closed

x/sys/windows: Expose timeBeginPeriod and timeEndPeriod #61723

johnrs opened this issue Aug 2, 2023 · 5 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Milestone

Comments

@johnrs
Copy link

johnrs commented Aug 2, 2023

Problem: A breaking change made in Go 1.16, 2.5 years ago, and is ongoing. It affects Windows users. See Issue #44343 for details and links to other issues for the same problem.

Discussion: This proposal would help to mitigate the problem. It would make it much easier for a user, unfamiliar with Windows system calls, to use timeBeginPeriod and timeEndPeriod, which have been identified as a workaround. Using these, a user could manually set the system clock to the desired resolution, typically 1ms or 15.6ms. This workaround has been determined to not interfere with the current Go runtime. It has been tested by multiple people and found to work.

@johnrs johnrs added the Proposal label Aug 2, 2023
@gopherbot gopherbot added this to the Proposal milestone Aug 2, 2023
@qmuntal
Copy link
Contributor

qmuntal commented Aug 3, 2023

I'm in favor of doing this, as @johnrs mentioned, it will help mitigating #44343.

@golang/windows

@ianlancetaylor
Copy link
Member

In general it's always fine to add new functions that call standard Windows functions to x/sys/windows. That can be done without a proposal. A proposal is only required if it's not a standard Windows function, or if the function can't be called in an ordinary way (perhaps it requires a special data structure or something). That doesn't seem to be the case here, so taking this out of the proposal process. Thanks.

@ianlancetaylor ianlancetaylor changed the title proposal: x/sys/windows: Expose timeBeginPeriod and timeEndPeriod x/sys/windows: Expose timeBeginPeriod and timeEndPeriod Aug 4, 2023
@ianlancetaylor ianlancetaylor added help wanted NeedsFix The path to resolution is known, but the work has not been done. and removed Proposal labels Aug 4, 2023
@ianlancetaylor ianlancetaylor modified the milestones: Proposal, Unreleased Aug 4, 2023
@qmuntal
Copy link
Contributor

qmuntal commented Aug 4, 2023

Thanks for the clarification @ianlancetaylor.

@johnrs do you feel like submitting a CL with the proposed changes?

@johnrs
Copy link
Author

johnrs commented Aug 4, 2023

@qmuntal It would be better if you did. My knowledge of Windows system calls and how Go uses them isn't that strong.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/515915 mentions this issue: windows: add TimeBeginPeriod and TimeEndPeriod syscalls

@golang golang locked and limited conversation to collaborators Aug 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Projects
None yet
Development

No branches or pull requests

4 participants