Skip to content

Introduce wait queues for blocking kernel tasks #185

Open

Description

@cellrishi-code

Summary

Provide a reusable wait-queue primitive so tasks can sleep until a condition or event becomes available instead of repeatedly polling.

Scope

  • Define enqueue, wake-one, wake-all, and cancellation semantics.
  • Prevent lost wakeups when a condition changes while a task is preparing to sleep.
  • Specify lock ordering and the interaction with scheduler run queues.
  • Keep the primitive independent of specific devices or syscall implementations.

Acceptance criteria

  • Host tests cover empty queues, multiple waiters, wake-one, wake-all, and repeated enqueue/dequeue.
  • Tests or a deterministic model cover the condition-check/sleep race.
  • Woken tasks become runnable exactly once.
  • Document interrupt-context restrictions and locking invariants.

Engineering constraints

  • Keep the kernel Rust-first, no_std, and x86_64-compatible.
  • Integrate with existing Rustalis subsystem interfaces; do not create a parallel implementation.
  • Document ownership, initialization order, failure behavior, and any architecture-specific unsafe invariants.
  • Add host-side tests for hardware-independent logic and QEMU coverage for hardware paths where practical.
  • Do not claim verification that has not actually been run.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions