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

Merge latest Library.Template #1147

Merged
merged 11 commits into from
Feb 10, 2025
4 changes: 2 additions & 2 deletions .github/workflows/docs_validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: 🔗 Markup Link Checker (mlc)
uses: becheran/mlc@v0.19.2
uses: becheran/mlc@v0.21.0
with:
args: --do-not-warn-for-redirect-to https://learn.microsoft.com*,https://dotnet.microsoft.com/*,https://dev.azure.com/*,https://app.codecov.io/*,https://github.com/Microsoft/vs-threading/* -p docfx -i https://aka.ms/onboardsupport,https://aka.ms/spot,https://msrc.microsoft.com/*,https://www.microsoft.com/msrc*,https://microsoft.com/msrc*
args: --do-not-warn-for-redirect-to https://learn.microsoft.com*,https://dotnet.microsoft.com/*,https://dev.azure.com/*,https://app.codecov.io/*,https://microsoft.github.io/vs-threading/* -p docfx -i https://aka.ms/onboardsupport,https://aka.ms/spot,https://msrc.microsoft.com/*,https://www.microsoft.com/msrc*,https://microsoft.com/msrc*
- name: ⚙ Install prerequisites
run: |
./init.ps1 -UpgradePrerequisites
Expand Down
12 changes: 6 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<MessagePackVersion>2.5.192</MessagePackVersion>
<MicroBuildVersion>2.0.181</MicroBuildVersion>
<VisualStudioThreadingVersion>17.13.37</VisualStudioThreadingVersion>
<CodeAnalysisAnalyzerVersion>3.11.0-beta1.25074.1</CodeAnalysisAnalyzerVersion>
<MicroBuildVersion>2.0.187</MicroBuildVersion>
<VisualStudioThreadingVersion>17.12.19</VisualStudioThreadingVersion>
<CodeAnalysisAnalyzerVersion>3.11.0-beta1.24605.2</CodeAnalysisAnalyzerVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" />
Expand Down Expand Up @@ -36,10 +36,10 @@
<PackageVersion Include="xunit.stafact" Version="2.0.36-alpha" />
</ItemGroup>
<ItemGroup Label="Library.Template">
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageVersion Include="Microsoft.VisualStudio.Internal.MicroBuild.NonShipping" Version="$(MicroBuildVersion)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.1" />
<PackageVersion Include="xunit.v3" Version="1.0.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
<PackageVersion Include="xunit.v3" Version="1.1.0" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="$(CodeAnalysisAnalyzerVersion)" />
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines/install-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ steps:
- template: WIFtoPATauth.yml
parameters:
wifServiceConnectionName: azure-public/vside package pull
deadPATServiceConnectionId: 0ae39abc-4d06-4436-a7b5-865833df49db # azure-public/msft_consumption
deadPATServiceConnectionId: 46f0d4d4-9fff-4c58-a1ab-3b8f97e3b78a # azure-public/msft_consumption_public

- task: NuGetAuthenticate@1
displayName: 🔏 Authenticate NuGet feeds
inputs:
${{ if and(parameters.needsAzurePublicFeeds, eq(variables['system.collectionId'], '011b8bdf-6d56-4f87-be0d-0092136884d9')) }}:
nuGetServiceConnections: azure-public/msft_consumption
nuGetServiceConnections: azure-public/msft_consumption_public

- powershell: |
$AccessToken = '$(System.AccessToken)' # Avoid specifying the access token directly on the init.ps1 command line to avoid it showing up in errors
Expand Down
6 changes: 4 additions & 2 deletions doc/joinableTaskFactory.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ In fact multiple processes with their own main threads can contribute to the tok

### Processes with a main thread

To resolve the deadlock, we need to follow the 3rd of [the threading rules of the `JoinableTaskFactory`](https://github.com/microsoft/vs-threading/blob/main/doc/threading_rules.md) by carefully applying `JoinableTaskFactory.RunAsync` such that the causal relationship is observed by the `JoinableTaskFactory` so it can mitigate the deadlocks.
To resolve the deadlock, we need to follow the 3rd of [the threading rules of the `JoinableTaskFactory`][ThreadingRules] by carefully applying `JoinableTaskFactory.RunAsync` such that the causal relationship is observed by the `JoinableTaskFactory` so it can mitigate the deadlocks.

An application that has a main thread and an instance of `JoinableTaskContext` should set the `JsonRpc.JoinableTaskFactory` property to an instance of `JoinableTaskFactory`.
Doing this has the following effects:
Expand All @@ -56,7 +56,7 @@ Doing this has the following effects:
This property carries a token that represents the `JoinableTask` that needs the RPC call to complete.
2. When an inbound JSON-RPC request carries a `joinableTaskToken` top-level property, the request will be dispatched within a `JoinableTask` that was created based on the token provided in the message.

Taken together, these two effects ensure that when an RPC call requires the main thread to fulfill, and the RPC client is blocking the main thread, that the `JoinableTaskFactory` will be able to mitigate deadlocks by allowing the RPC server to access the main thread that is owned by the RPC client, assuming both parties are following the [`JoinableTaskFactory` threading rules](https://github.com/microsoft/vs-threading/blob/main/doc/threading_rules.md).
Taken together, these two effects ensure that when an RPC call requires the main thread to fulfill, and the RPC client is blocking the main thread, that the `JoinableTaskFactory` will be able to mitigate deadlocks by allowing the RPC server to access the main thread that is owned by the RPC client, assuming both parties are following the [`JoinableTaskFactory` threading rules][ThreadingRules].

This holds even when one or more intermediate processes exist between the client and server, provided each process propagates the `joinableTaskToken` top-level property.

Expand Down Expand Up @@ -115,3 +115,5 @@ The token is created and consumed by the `JoinableTask` APIs and is an implement
A corrupted token MAY be logged or discarded.
- A missing token MUST NOT lead to any malfunction other than the inability to mitigate deadlocks.
- A token SHOULD NOT disclose any confidential data.

[ThreadingRules]: https://microsoft.github.io/vs-threading/docs/threading_rules.html
2 changes: 1 addition & 1 deletion nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</config>
<packageSources>
<clear />
<add key="msft_consumption" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/msft_consumption/nuget/v3/index.json" />
<add key="msft_consumption_public" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/msft_consumption_public/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<!-- Defend against user or machine level disabling of sources that we list in this file. -->
Expand Down