Skip to content

[SYCL] Add one more WA on Win for shutdown process #19195

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 4 commits into from
Jul 18, 2025

Conversation

KseniyaTikhomirova
Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova commented Jun 27, 2025

WA for host task threads handling.
We must call join() or detach() on host task execution thread to avoid UB.
DLLMain parameter lpReserved == NULL if library is unloaded via FreeLibrary.
In this case we can't join threads within DllMain call due to global loader lock
and DLL_THREAD_DETACH signalling.
lpReserved != NULL if library is unloaded during process termination. In this case
Windows terminates threads but leave them in signalled state, prevents
DLL_THREAD_DETACH notification and we can call join() as NOP.

Note that FreeLibrary called with sycl RT handle does not guarantee which path
will be used. Windows can (and actually does) simply postpone actual unloading
till the end of program.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova KseniyaTikhomirova changed the title [SYCL] Add one more WA on WIn for shutdown process [SYCL] Add one more WA on Win for shutdown process Jun 27, 2025
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova
Copy link
Contributor Author

Failed tests are not unique for my PR: https://github.com/intel/llvm/actions/runs/15937270979/job/44966158959?pr=19205
So these failures are not related.

@KseniyaTikhomirova KseniyaTikhomirova marked this pull request as ready for review July 11, 2025 12:18
@KseniyaTikhomirova KseniyaTikhomirova requested a review from a team as a code owner July 11, 2025 12:18
@KseniyaTikhomirova
Copy link
Contributor Author

@intel/llvm-gatekeepers hi, this PR is ready to be merged. thanks!

@steffenlarsen steffenlarsen merged commit 8f06a1d into intel:sycl Jul 18, 2025
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants