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

standalone-enc: move fd_drain() to a separate file #414

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gperciva
Copy link
Member

No description provided.

@gperciva
Copy link
Member Author

It's useful to share fd_drain() -- or rather, fd_drain_fork() -- between multiple tests.

At the moment it's only used in _transfer_noencrypt.c and _pipe_socketpair_one.c, but we'll be adding _pipe_socketpair_two.c soon.

* Drain bytes from the file descriptor ${*fd_p} -- passed as an (int *) -- as
* quickly as possible.
*/
int fd_drain(void *);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My original intent was only to expose fd_drain_fork(), but standalone_transfer_noencrypt.c uses threads rather than processes, so it needs to call fd_drain() directly.

@gperciva
Copy link
Member Author

This has no impact on the perftest timings.

When I first glanced at it with N=5 it looked like it did, but repeating the test with N=11 and then N=31 showed it was a fluke.

@gperciva gperciva force-pushed the standalone-fd-drain branch from 5407ce1 to 2133364 Compare January 14, 2025 01:23
- rename pipe_output() to fd_drain()
- rename MAXOUTSIZE to FD_DRAIN_MAX_SIZE
- use (int *) instead of (struct pipeinfo)
- add fd_drain_fork_start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant