Skip to content

Conversation

@kammce
Copy link
Member

@kammce kammce commented Nov 29, 2025

This PR introduces basic testing infrastructure for the async context system, demonstrating coroutine scheduling and stack memory management.

Changes

  • Added coroutine test case: Implements coro_print() coroutine that exercises co_await with time-based suspension
  • Implemented test scheduler: Created my_scheduler that tracks sleep events and demonstrates the do_schedule() interface
  • Stack memory setup: Tests the current strong_ptr<std::span<byte>> pattern for coroutine stack allocation
  • Added TODO comments:

Current Limitations

The test reveals that the scheduler's do_schedule() is not being invoked during co_await suspension points. This needs investigation and is tracked in #19.

The current stack memory API requires two separate allocations (array + span) with no lifetime bond between them, identified as a safety concern in #18.

Test Coverage

  • ✅ Coroutine creation and execution
  • ✅ Multiple suspension points with co_await
  • sync_wait() completing the coroutine
  • ⚠️ Scheduler integration (not yet working)

PR message co-authored-by: Claude noreply@anthropic.com

Edit, the latest commit resolves #19

@kammce
Copy link
Member Author

kammce commented Nov 30, 2025

This change resolves #19

@kammce kammce merged commit 630eb04 into main Nov 30, 2025
@kammce kammce deleted the decouple branch November 30, 2025 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduler isn't being called

2 participants