Skip to content

External Execution Interface #4616

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 46 commits into from
May 7, 2025
Merged

External Execution Interface #4616

merged 46 commits into from
May 7, 2025

Conversation

nibanks
Copy link
Member

@nibanks nibanks commented Oct 16, 2024

Description

Closes #1923.

Provides an interface for the application layer to completely control execution of all MsQuic work. In other words, MsQuic would create no threads internally.

Testing

Added a sample application that uses the new interface to drive MsQuic execution.
Needs to add some automation.

Documentation

Added some overview docs.
Need to add docs for the new APIs.

@nibanks nibanks added Area: Performance Area: API Area: Core Related to the shared, core protocol logic labels Oct 16, 2024
@nibanks nibanks changed the title Initial External Execution Interface External Execution Interface Oct 16, 2024
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 30.18868% with 37 lines in your changes missing coverage. Please review.

Project coverage is 85.73%. Comparing base (8cce724) to head (2924b64).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/core/library.c 20.45% 35 Missing ⚠️
src/core/worker.c 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4616      +/-   ##
==========================================
- Coverage   85.81%   85.73%   -0.09%     
==========================================
  Files          59       59              
  Lines       17995    18035      +40     
==========================================
+ Hits        15443    15462      +19     
- Misses       2552     2573      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nibanks nibanks marked this pull request as ready for review May 6, 2025 13:21
@nibanks nibanks requested a review from a team as a code owner May 6, 2025 13:21
@microsoft microsoft deleted a comment from github-actions bot May 6, 2025
@microsoft microsoft deleted a comment from github-actions bot May 6, 2025

#[cfg(target_os = "windows")]
#[repr(C)]
pub struct OVERLAPPED {
Copy link
Contributor

Choose a reason for hiding this comment

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

U can allowlist the bindgen types by add them here:
https://github.com/microsoft/msquic/blob/58fd56c6ba8b8190042660ca83d7748b7a1ca558/scripts/build.rs#L210C1-L210C61

This saves the manual work here but can get a lot more generated code.
I originally blocklisted QUIC_ADDR because it creates too much code for manipulating socket_addr.
Maybe we should allowlist all types and get rid of the c_types dependencies.

if (GetQueuedCompletionStatusEx(IOCP, Overlapped, ARRAYSIZE(Overlapped), &OverlappedCount, WaitTime, FALSE)) {
for (ULONG i = 0; i < OverlappedCount; ++i) {
QUIC_SQE* Sqe = CONTAINING_RECORD(Overlapped[i].lpOverlapped, QUIC_SQE, Overlapped);
Sqe->Completion(&Overlapped[i]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can user quic callback event be invoked on this user thread here?
(I am thinking about if it is possible to write a single thread application, and potential deadlocks.)

Copy link
Member Author

@nibanks nibanks May 6, 2025

Choose a reason for hiding this comment

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

Yes, the app I added in this PR is single threaded. It works and I have the logs to prove it.

@nibanks nibanks merged commit a8d6682 into main May 7, 2025
287 of 290 checks passed
@nibanks nibanks deleted the external-execution branch May 7, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: API Area: Core Related to the shared, core protocol logic Area: Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow using an app-provided thread
4 participants