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

Refactor scan() #1413

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Refactor scan() #1413

merged 1 commit into from
Nov 2, 2023

Conversation

tavianator
Copy link
Collaborator

@tavianator tavianator commented Oct 29, 2023

No description provided.

src/walk.rs Outdated Show resolved Hide resolved
src/walk.rs Outdated Show resolved Hide resolved
src/walk.rs Outdated Show resolved Hide resolved
Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Thank you very much. Also a clear improvement on code structure!

@tavianator tavianator marked this pull request as draft November 1, 2023 20:52
@tavianator tavianator changed the title walk: Do the receiver work from the main thread Refactor scan() Nov 2, 2023
@tavianator tavianator marked this pull request as ready for review November 2, 2023 14:10
Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Thank you for the update.

@sharkdp sharkdp merged commit 8bbbd76 into sharkdp:master Nov 2, 2023
15 checks passed
@tavianator tavianator deleted the worker-state branch November 2, 2023 16:14
// Spawn the sender threads.
self.spawn_senders(walker, tx);

receiver.join().unwrap()
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of spawning a separate thread and joining on it here, could we just call self.receive(rx) here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried that originally but the problem is spawn_senders() is blocking. So we need an extra background thread either for receive() or spawn_senders().

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