Skip to content

Commit

Permalink
Remove the coordinator thread
Browse files Browse the repository at this point in the history
  • Loading branch information
wks committed Feb 2, 2024
1 parent 6f38359 commit 66dbe55
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 28 deletions.
4 changes: 2 additions & 2 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ lazy_static = "1.1"
# - change branch
# - change repo name
# But other changes including adding/removing whitespaces in commented lines may break the CI
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev="ef2bd6d043d8675badaa415db89be7b52439725f" }
mmtk = { git = "https://github.com/wks/mmtk-core.git", rev="7cb0b2c12be341c084e03f2cd943fad8ac088f83" }
# Uncomment the following to build locally
# mmtk = { path = "../repos/mmtk-core" }
log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] }
Expand Down
22 changes: 2 additions & 20 deletions mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::{BUILDER, DISABLED_GC, MUTATORS, USER_TRIGGERED_GC};
use libc::c_char;
use log::*;
use mmtk::memory_manager;
use mmtk::scheduler::GCController;
use mmtk::scheduler::GCWorker;
use mmtk::util::opaque_pointer::*;
use mmtk::util::{Address, ObjectReference, OpaquePointer};
Expand Down Expand Up @@ -132,15 +131,6 @@ pub extern "C" fn mmtk_gc_init(
}
}

#[no_mangle]
pub extern "C" fn mmtk_start_control_collector(
tls: VMWorkerThread,
gc_controller: *mut GCController<JuliaVM>,
) {
let mut gc_controller = unsafe { Box::from_raw(gc_controller) };
memory_manager::start_control_collector(&SINGLETON, tls, &mut gc_controller);
}

#[no_mangle]
pub extern "C" fn mmtk_bind_mutator(tls: VMMutatorThread, tid: usize) -> *mut Mutator<JuliaVM> {
let mutator_box = memory_manager::bind_mutator(&SINGLETON, tls);
Expand Down Expand Up @@ -231,8 +221,8 @@ pub extern "C" fn mmtk_will_never_move(object: ObjectReference) -> bool {

#[no_mangle]
pub extern "C" fn mmtk_start_worker(tls: VMWorkerThread, worker: *mut GCWorker<JuliaVM>) {
let mut worker = unsafe { Box::from_raw(worker) };
memory_manager::start_worker::<JuliaVM>(&SINGLETON, tls, &mut worker)
let worker = unsafe { Box::from_raw(worker) };
memory_manager::start_worker::<JuliaVM>(&SINGLETON, tls, worker)
}

#[no_mangle]
Expand Down Expand Up @@ -477,14 +467,6 @@ pub extern "C" fn mmtk_start_spawned_worker_thread(
mmtk_start_worker(tls, ctx);
}

#[no_mangle]
pub extern "C" fn mmtk_start_spawned_controller_thread(
tls: VMWorkerThread,
ctx: *mut GCController<JuliaVM>,
) {
mmtk_start_control_collector(tls, ctx);
}

#[inline(always)]
pub fn store_obj_size(obj: ObjectReference, size: usize) {
let addr_size = obj.to_raw_address() - 16;
Expand Down
7 changes: 2 additions & 5 deletions mmtk/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@ impl Collection<JuliaVM> for VMCollection {
Address::from_usize(thread_id::get())
})));
match ctx {
GCThreadContext::Controller(mut c) => {
mmtk::memory_manager::start_control_collector(&SINGLETON, worker_tls, &mut c)
}
GCThreadContext::Worker(mut w) => {
mmtk::memory_manager::start_worker(&SINGLETON, worker_tls, &mut w)
GCThreadContext::Worker(w) => {
mmtk::memory_manager::start_worker(&SINGLETON, worker_tls, w)
}
}
});
Expand Down

0 comments on commit 66dbe55

Please sign in to comment.