This issue manifested while running process cycles where current process, process_a, creates process_b and process_b creates process_a. We would randomly hit a page fault while trying to access the process list. The issue was that the reference in the process list was randomly destroyed. We need to explicitly tell the compiler that the process list contains data that will live long at runtime.
We'll use Arc instead of Rc because the references will also need to be safely shared across different CPUs when APIC is supported.
Use generic trait object for dynamic dispatch in process_ret
Our first stab at dynamic dispatch in the process_ret function assumed that the scheduler will always be a CoopScheduler. Since we know our scheduler will always implement kill, we should use the more general DoesScheduling trait object to call the kill method. Now, we can truly use any scheduler object in the kernel to create and kill processes properly.
This is a follow-up to #33 that aims to stabilize the scheduling code and make various quality of life improvements to the module.
Reference counting in process list
Fixes #36
The processes in the process list should be reference counted. We need to guarantee that data shared between context switches will not be destroyed..
This issue manifested while running process cycles where current process,
process_a
, createsprocess_b
andprocess_b
createsprocess_a
. We would randomly hit a page fault while trying to access the process list. The issue was that the reference in the process list was randomly destroyed. We need to explicitly tell the compiler that the process list contains data that will live long at runtime.We'll use
Arc
instead ofRc
because the references will also need to be safely shared across different CPUs when APIC is supported.Use generic trait object for dynamic dispatch in
process_ret
Our first stab at dynamic dispatch in the
process_ret
function assumed that the scheduler will always be aCoopScheduler
. Since we know our scheduler will always implementkill
, we should use the more generalDoesScheduling
trait object to call the kill method. Now, we can truly use any scheduler object in the kernel to create and kill processes properly.