This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert two changes to thread requests (#14015)
Reverting 99db31c and fd91ee1 to unblock others while trying to figure out what the issues are and how to fix them. fd91ee1 is causing @benaadams thread pool perf test (https://github.com/benaadams/ThreadPoolTaskTesting) to hang due to a missed thread request. Somehow wsqActive is ending up at zero while there is a work item in the queue and with no pending thread requests. I don't understand how yet. 99db31c appears to have a potential issue because the order of MarkThreadRequestSatisfied and Dequeue are reversed. For instance, assuming a proc count of 1: - Initial state: 1 work item enqueued, 1 thread request - T1 Dispatch: dequeues a work item and requests a thread (0 work items, 1 thread request) - T1 Dispatch: sees no more work items, returns - T1 calls Dispatch again due to its own thread request - T1 Dispatch: After Dequeue (which saw 0 work items) and before MarkThreadRequestSatisfied: - Current state: 0 work items, 1 thread request - T2 enqueues a work item, sees 1 thread request and does not request a thread (1 work item, 1 thread request) - T1 Dispatch: MarkThreadRequestSatisfied decrements thread requests (1 work item, 0 thread requests) - Now after T1 returns, it won't wake up again but there is still one work item in the queue
- Loading branch information
Showing
1 changed file
with
30 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters