How sdetn/hev-task-system works
Main Components
a) Task Management Layer
• Task Scheduler (src/kern/core)
• Task Execution Engine (src/kern/task)
• Architecture-specific Context Switching (src/arch/*)
b) Core Services Layer
• I/O Reactor System (src/kern/io)
• Timer Management (src/kern/time)
• Inter-Task Communication (src/kern/itc)
• Synchronization Primitives (src/kern/sync)
c) Memory Management Layer
• Memory Allocator (src/mem)
• Stack Management (src/kern/task/hev-task-stack-*)
d) Library Layer
• I/O Operations (src/lib/io)
• DNS Support (src/lib/dns)
• Buffer Management (src/lib/io/buffer)
• Object System (src/lib/object)
┌─────────────────────────────────────────────────────┐
• Application Layer │
• ┤
• API Layer │
• (Task API, Channel API, I/O API, Memory API, etc.) │
• ┤
• Core Services Layer │
• ┌──────────┐ ┌─────────┐ ┌────────┐ ┌─────────┐ │
• Scheduler │ │ I/O │ │ ITC │ │ Sync │ │
• ┘ └─────────┘ └────────┘ └─────────┘ │
• ┤
• Task Execution Layer │
• ┌──────────┐ ┌─────────┐ ┌────────────────────┐ │
• Context │ │ Stack │ │ Architecture- │ │
• Switching │ │ Manager │ │ specific Execution │ │
• ┘ └─────────┘ └────────────────────┘ │
• ┤
• Memory Management Layer │
• ┘
Important Elements to Highlight
• Blue: Core task management components
• Green: I/O and communication components
• Yellow: Memory management components
• Purple: Architecture-specific components
• Control flow between components
• Data flow in inter-task communication
• Dependency relationships
Additional Details
A separate section showing:
• Memory allocation patterns
• Task state transitions
• I/O reactor implementation differences (epoll/kqueue)
• Inter-task communication channels
Notes for Implementation Details
• How tasks are scheduled and switched
• Where context switching occurs
• Demonstrate the relationship between tasks and system resources
• Memory allocation strategy