Skip to content

Commit d47b99e

Browse files
[SYCL] Win: do not cleanup scheduler resources due to unpredictable s… (#7801)
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]>
1 parent d7a7de7 commit d47b99e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sycl/source/detail/scheduler/scheduler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ Scheduler::Scheduler() {
365365
Scheduler::~Scheduler() { DefaultHostQueue.reset(); }
366366

367367
void Scheduler::releaseResources() {
368+
#ifndef _WIN32
368369
if (DefaultHostQueue) {
369370
DefaultHostQueue->wait();
370371
}
@@ -385,6 +386,7 @@ void Scheduler::releaseResources() {
385386
// added to deferred mem obj storage. So we may end up with leak.
386387
while (!isDeferredMemObjectsEmpty())
387388
cleanupDeferredMemObjects(BlockingT::BLOCKING);
389+
#endif
388390
}
389391

390392
MemObjRecord *Scheduler::getMemObjRecord(const Requirement *const Req) {

0 commit comments

Comments
 (0)