Skip to content
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

Reimplement um_op and related code #1

Merged
merged 26 commits into from
Nov 11, 2024
Merged

Reimplement um_op and related code #1

merged 26 commits into from
Nov 11, 2024

Conversation

noteflakes
Copy link

This PR simplifies the lifetime and state management of um_op structs.

  • For most ops, the struct is on the stack instead of in the heap.
  • Op state is greatly simplified.
  • Stability is greatly improved as a result.
  • transient ops (i.e. schedule and timeout ops) are recycled using a freelist.
  • multishot result structs are also recycled with a freelist.

Other changes:

  • Update liburing
  • Add basic DNS resolver

Care should be taken when working with fibers with regards to keeping refs to objects used in ongoing ops. Apparently, calls to RB_GC_GUARD for guarding refs on a fiber's stack are useless *unless* we keep a ref to the fiber somewhere. Otherwise, the fiber and all refs on its stack might be GC'd prematurely, leading to a segfault.

We therefore do both of the following:

1. Keep running fibers in a fibermap.
2. Keep refs to objects for transient ops in a linked list.
@noteflakes noteflakes merged commit 8f36d7d into main Nov 11, 2024
3 checks passed
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.

None yet

1 participant