[SYCL] Win: do not cleanup scheduler resources due to unpredictable s… #7801
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Windows specific.
Do not try to release any resources during program exit. It may cause unpredictable results.
The main root cause is threads. Per my observations and according to windows ExitProcess docs threads are killed before libraries unload. So at the time when we call shutdown - thread pool threads and any other user threads will already be killed. What it means to us: we could not know exactly the state of jobs and objects they was working with. For example graph mutex could be locked by thread executing by host task, or container state could be undefined if killed thread was working with it, or additional user thread could call sycl API and some resources of sycl dependencies could be also affected.
Signed-off-by: Tikhomirova, Kseniya [email protected]