Skip to content

Conversation

@Paraworker
Copy link
Contributor

This PR introduces the scheduler module, which encapsulates all task scheduling logic.

@George-Miao George-Miao added enhancement New feature or request package: runtime Related to compio-runtime labels Oct 21, 2025
@Berrysoft Berrysoft requested a review from Copilot October 21, 2025 15:08
@Berrysoft Berrysoft added refactor Refactoring existing code and removed enhancement New feature or request labels Oct 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the task scheduling logic by extracting it into a dedicated Scheduler module. The changes centralize scheduling responsibilities, improve code organization, and remove scattered scheduling logic from the main runtime implementation.

Key changes:

  • Introduced a new Scheduler struct that encapsulates task queue management and execution logic
  • Created TaskQueue to manage both local and synchronized task queues
  • Moved scheduling logic from Runtime into the dedicated scheduler module

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
compio-runtime/src/runtime/scheduler/mod.rs Introduces the new Scheduler and TaskQueue types with task spawning and execution methods
compio-runtime/src/runtime/scheduler/local_queue.rs Implements a thread-local queue wrapper (LocalQueue) for non-Sync interior mutability
compio-runtime/src/runtime/mod.rs Refactors Runtime to use the new Scheduler, removing inline scheduling logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@Berrysoft Berrysoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'm not that sure about the usage of UnsafeCell. I request @George-Miao to review local_queue.rs.

George-Miao
George-Miao previously approved these changes Oct 21, 2025
Copy link
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Just update the SAFETY note. Thanks for the PR!

@George-Miao George-Miao merged commit 5e969cb into compio-rs:master Oct 21, 2025
49 checks passed
@Paraworker Paraworker deleted the refactor/scheduler branch October 21, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: runtime Related to compio-runtime refactor Refactoring existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants