Skip to content

event: support workqueue monitoring on Windows #585

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

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Nov 15, 2021

This enables workqueue monitoring on Windows to allow for overcommitting
threads if necessary. We use a combination of WCT (wait chain tracing)

  • to determine if there is an object being waited upon - and IO checking
  • to determine if there is pending IO - to identify threads which are
    executing workloads. If no threads are executing workloads, then we may
    be in a starvation state and will initialize new threads. This should
    fix the issue that has been previously reported with SPM hangs.

This is non-portable and ideally we would have an alternative approach
to tracking thread state, but this should at least unblock the current
situation.

This enables workqueue monitoring on Windows to allow for overcommitting
threads if necessary.  We use a combination of WCT (wait chain tracing)
- to determine if there is an object being waited upon - and IO checking
- to determine if there is pending IO - to identify threads which are
executing workloads.  If no threads are executing workloads, then we may
be in a starvation state and will initialize new threads.  This should
fix the issue that has been previously reported with SPM hangs.

This is non-portable and ideally we would have an alternative approach
to tracking thread state, but this should at least unblock the current
situation.
@compnerd
Copy link
Member Author

CC: @rokhinip

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd compnerd changed the title event: attempt to support workqueue monitoring on Windows event: support workqueue monitoring on Windows Nov 18, 2021
@compnerd compnerd merged commit 171733b into swiftlang:main Nov 18, 2021
@compnerd compnerd deleted the overcommitted branch November 18, 2021 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant