CoreThreadScheduling
Document the CoreThreadScheduling JNode concept in the wiki.
Value: 5
Concept Summary
Hybrid preemptive/cooperative thread scheduler with yieldpoints and TSI (Thread State Indicator). CoreThreadScheduling combines the responsiveness of preemptive scheduling with the efficiency of cooperative scheduling for optimal thread management.
Key Files
- core/src/core/org/jnode/vm/scheduler/TSI.java
- core/src/core/org/jnode/vm/scheduler/ThreadScheduler.java
- core/src/core/org/jnode/vm/scheduler/Dispatcher.java
Occurrences
~200 references in core/src/core
Wiki Status
Partially covered (page exists but incomplete)
Bridges
VM, Scheduler, Thread management
Instructions
Skill to Use
Use the [[update-wiki|update-wiki skill]] (load with skill({ name: "update-wiki" })) for understanding JNode internals.
Context Research
Research the scheduler to understand how preemptive and cooperative scheduling are combined. Study TSI.java for atomic state management, ThreadScheduler.java for scheduling logic, and Dispatcher.java for execution context switching. Review how yieldpoints enable cooperative scheduling.
Update index.md
- Pages table: Add entry for CoreThreadScheduling.md
- Concepts → Pages table: Add "CoreThreadScheduling" mapping to [[CoreThreadScheduling]]
- Source Path → Pages table: Add mappings for
core/src/core/org/jnode/vm/scheduler/
- Task Routing table: Add relevant task route(s)
Task Routing Suggestions
- Scheduler analysis: Read CoreThreadScheduling.md first when analyzing scheduler behavior
- Thread management issues: CoreThreadScheduling documentation explains the hybrid mechanism
- Performance optimization: Understanding the hybrid approach is key to optimizing thread performance
Wiki Page Structure
# CoreThreadScheduling
> Hybrid preemptive/cooperative thread scheduler with yieldpoints and TSI.
## Overview
2-3 paragraph explanation of the hybrid scheduling approach, how it combines preemptive and cooperative scheduling, and why this design was chosen for JNode.
## Key Components
| Class / File | Role |
|---|---|
| `core/src/core/org/jnode/vm/scheduler/TSI.java` | Thread state indicator with atomic updates |
| `core/src/core/org/jnode/vm/scheduler/ThreadScheduler.java` | Main scheduling logic with yieldpoint support |
| `core/src/core/org/jnode/vm/scheduler/Dispatcher.java` | Context switching and execution dispatch |
## How It Works
Step-by-step explanation of how preemptive and cooperative scheduling work together, the role of yieldpoints, and how TSI tracks thread states.
## Gotchas & Non-Obvious Behavior
- Yieldpoints must be placed strategically for cooperative scheduling to work effectively
- TSI state transitions must be atomic to prevent race conditions
- The hybrid approach allows both responsive scheduling and efficient context switching
## Related Pages
- [[TSI]]
- [[Yieldpoint]]
- [[Dispatcher]]
Related Concepts: TSI, Yieldpoint, Dispatcher, ThreadScheduler, Thread State
CoreThreadScheduling
Value: 5
Concept Summary
Hybrid preemptive/cooperative thread scheduler with yieldpoints and TSI (Thread State Indicator). CoreThreadScheduling combines the responsiveness of preemptive scheduling with the efficiency of cooperative scheduling for optimal thread management.
Key Files
Occurrences
~200 references in core/src/core
Wiki Status
Partially covered (page exists but incomplete)
Bridges
VM, Scheduler, Thread management
Instructions
Skill to Use
Use the [[update-wiki|update-wiki skill]] (load with
skill({ name: "update-wiki" })) for understanding JNode internals.Context Research
Research the scheduler to understand how preemptive and cooperative scheduling are combined. Study TSI.java for atomic state management, ThreadScheduler.java for scheduling logic, and Dispatcher.java for execution context switching. Review how yieldpoints enable cooperative scheduling.
Update index.md
core/src/core/org/jnode/vm/scheduler/Task Routing Suggestions
Wiki Page Structure
Related Concepts: TSI, Yieldpoint, Dispatcher, ThreadScheduler, Thread State