Skip to content

[SYCL] HostTask deadlock fix - #22993

Open
cperkinsintel wants to merge 2 commits into
intel:syclfrom
cperkinsintel:cperkins-deadlock-fix
Open

[SYCL] HostTask deadlock fix#22993
cperkinsintel wants to merge 2 commits into
intel:syclfrom
cperkinsintel:cperkins-deadlock-fix

Conversation

@cperkinsintel

Copy link
Copy Markdown
Contributor

Multiple worker threads submitting to an in-order queue can deadlock when the application holds a mutex across q.submit() calls whose host_tasks acquire that same mutex.

The solution is to drain the synchronous host-task dep waits once, at the top of GraphProcessor::waitForEvent, before calling enqueueCommand. A new collectPendingHostDepEvents walks Cmd's dep graph under the read lock and gathers every host-task event that would otherwise be waited on synchronously. Then we release the read lock, wait for them all, reacquire, and proceed with the normal enqueueCommand. Its internal waitForPreparedHostEvents calls now find events already signaled and return immediately, so the read lock is no longer held across any blocking host wait.

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.

1 participant