Skip to content

Improvements to internal ownership semantics #1145

@lionel-

Description

@lionel-
  • Get rid of Console::get_mut(). Use interior mutability on specific fields. Maybe with ArkRefCell that's only panicking in debug builds.

  • Some of the channels consumed by the readconsole event loop shouldn't be clonable. ReadConsole is reentrant, and cloning a receiver means only one of the clones gets a message. We currently clone them, but luckily the reentrant path shuts down the event loop beforehand. We should make an unclonable wrapper to enforce the property.

    // Cloning is necessary to avoid a double mutable borrow error
    let r_request_rx = self.r_request_rx.clone();
    let stdin_reply_rx = self.stdin_reply_rx.clone();
    let kernel_request_rx = self.kernel_request_rx.clone();
    let tasks_interrupt_rx = self.tasks_interrupt_rx.clone();
    let tasks_idle_rx = self.tasks_idle_rx.clone();
    let tasks_idle_any_rx = self.tasks_idle_any_rx.clone();

Not urgent (Ark is not exploding left and right) but would be nice to converge towards a safer setup.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions