Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net Processes - Facilitate Parallel Execution of LocalProcess (#9463)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> When using `async`/`await`, there is no guarantee that the method will actually run asynchronously. The internal implementation is free to return using a completely synchronous path. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Add `Task.Yield()` when starting `LocalProcess` to encourage the use of a separate sychronization context from the current one. - https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.yield?view=net-8.0 - https://finchett.com/understanding-task-yield/ - https://www.webdevtutor.net/blog/c-sharp-taskyield-example ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄
- Loading branch information