-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use AtomicReferenceArray to keep track of worker threads
For the most part the array of worker threads is read-only, however it may be updated from any thread when a worker thread transitions to blocking or back. Previously, a separate atomic variable was used to introduce memory barriers when accessing the array. This is discarded in favour of AtomicReferenceArray that specifically manages access to elements of the array. The `getWorkerThreads` method is replaced by a more limited `getWorkerThread(index: Int)` method. This is used by `WorkerThread` when checking for blocked threads, and the new method can be used to specifically access a single worker thread.
- Loading branch information
Showing
2 changed files
with
28 additions
and
30 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
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