Skip to content

Conversation

@EdmondDantes
Copy link
Contributor

No description provided.

- 016: Nested fibers in separate coroutines with symmetric switching
- 017: Multiple suspend/resume in different coroutines
- 018: GC with circular references between fibers and coroutines

Tests verify that fibers in different coroutines are independent
and properly delegate GC to coroutine handlers.
Copy link

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 adds comprehensive fiber support to the async coroutine system, enabling fibers to work seamlessly with the existing async scheduler. The implementation includes deadlock detection for yielded fiber coroutines, scope validation, and updates to the libuv reactor logic.

Key Changes:

  • Added deadlock resolution logic for fiber coroutines in YIELD state
  • Implemented scope validation check before coroutine enqueue
  • Modified libuv reactor return logic to handle fiber scenarios

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
scheduler.c Added fiber-aware deadlock detection and scope validation for coroutine enqueuing
libuv_reactor.c Modified reactor execute return logic for fiber integration
coroutine.h Added zend_fibers.h header include
tests/fiber/*.phpt 28 comprehensive test files covering fiber basics, edge cases, and cancellation
tests/edge_cases/*.phpt 3 test files for fiber-spawn interaction scenarios and GC behavior
tests/stream/032-stream_select_null_timeout.phpt Test for stream_select with null timeout in fiber context

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ccurs in the main coroutine while the GC is running.
@EdmondDantes EdmondDantes merged commit 38fa354 into main Dec 16, 2025
1 check passed
@EdmondDantes EdmondDantes deleted the fiber-support branch December 16, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants