Skip to content

Fibers: adds internal version=ucontext_Posix #21368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

denizzzka
Copy link
Contributor

@denizzzka denizzzka commented May 11, 2025

This was all already here, but PR was dedicated to fix another thing. That's why I decided to put it in a separate PR

This PR assigns a separate version for Fiber context switching based on Posix's ucontext. So that it can be used manually (by enforcing version=ucontext_Posix) on any Posix system fort comparing context switching operation for debugging and testing purposes.

To make this work ucontext's swapcontext block was moved to the beginning of version conditionals.

Nothing will change for end users by this PR. At the same time, druntime developers will be able to switch Fiber's swapcontext from our own native assembler implementations to supplied by Posix's to check and compare context switching functionality. Maintainers will be able urgently switch to the Posix implementation if it is found that one of our implementations broken

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @denizzzka! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#21368"

@denizzzka denizzzka changed the title Adds ucontext switch internal version Fibers: adds internal version=ucontext_Posix May 11, 2025
Available only on Posix platforms. Useful for testing purposes.
@denizzzka denizzzka force-pushed the adds_context_switch_version branch from b1ff001 to e967d7f Compare May 12, 2025 09:00
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.

3 participants