forked from mmtk/mmtk-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit fixes an inconsistency in the VMCollection interface where a GCWorker is exposed to the binding via `Collection::spawn_worker_thread` as a `&GCWorker`, but later received from the binding via `memory_manager::start_worker` as a `&mut GCWorker`. The root cause is because GCWorker is wrongly owned by the scheduler. We make each GC worker thread the owner of its `GCWorker` struct, and we pass the `GCWorker` struct across API boundary as owning `Box`, fixing the interface. We isolate the part of `GCWorker` shared with the GC scheduler into a `GCWorkerShared` struct, and ensure the fields are properly synchronized. Particularly, we now use `AtomicRefCell` for `WorkerLocalStat`. `AtomicRefCell` allows it to be borrowed mutably by the GC worker and the mutator (via `harness_begin/end` methods) at different time. However, it is a known issue that in concurrent GC, it is possible for GC to happen when `harness_begin/end` is called. In that case, it will panic. Fixes: mmtk#522
- Loading branch information
Showing
8 changed files
with
133 additions
and
59 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
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
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
Oops, something went wrong.