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

File descriptor safety #116

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JonathanWoollett-Light
Copy link
Contributor

Summary of the PR

Replaces RawFd with OwnedFds to ensure file descriptors are
handled safely.

Benchmarks

process_basic           time:   [11.721 µs 11.739 µs 11.764 µs]
Found 16 outliers among 200 measurements (8.00%)
  10 (5.00%) high mild
  6 (3.00%) high severe

process_with_arc_mutex  time:   [13.959 µs 13.963 µs 13.968 µs]
Found 7 outliers among 200 measurements (3.50%)
  6 (3.00%) high mild
  1 (0.50%) high severe

process_with_inner_mut  time:   [12.488 µs 12.501 µs 12.516 µs]
Found 16 outliers among 200 measurements (8.00%)
  9 (4.50%) high mild
  7 (3.50%) high severe

process_dynamic_dispatch
                        time:   [24.849 µs 24.858 µs 24.867 µs]
Found 16 outliers among 200 measurements (8.00%)
  10 (5.00%) high mild
  6 (3.00%) high severe

process_dispatch_few_events
                        time:   [671.91 ns 672.21 ns 672.52 ns]
Found 10 outliers among 200 measurements (5.00%)
  2 (1.00%) low mild
  4 (2.00%) high mild
  4 (2.00%) high severe

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR are signed (with git commit -s), and the commit
    message has max 60 characters for the summary and max 75 characters for each
    description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
Allowing a return value for the event closures. 
This allows for proper error propagation.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
Replaces `RawFd` with `OwnedFd`s to ensure file descriptors are
handled safely.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
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.

1 participant