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

Remove Arc overhead #10

Closed
wants to merge 1 commit into from
Closed

Remove Arc overhead #10

wants to merge 1 commit into from

Conversation

psibi
Copy link
Member

@psibi psibi commented Aug 14, 2024

We could use static and share the AtomicBool with the other threads and avoid Arc.

We could use static and share the AtomicBool with the other threads
and avoid Arc.
@psibi psibi requested a review from snoyberg August 14, 2024 12:43
Copy link
Member

@snoyberg snoyberg left a comment

Choose a reason for hiding this comment

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

This looks fine, but I wonder if we should take it one more step: scoped threads. It's OK to use static here since we know there will only ever be one call to this function, but code that avoided that unstated invariant would be slightly nicer.

@psibi
Copy link
Member Author

psibi commented Aug 14, 2024

Given our discussion of static variables, Arc, and Box, I'm leaning towards Arc as the preferred approach. Since using scoped threads adds unnecessary complexity, I'm closing the PR.

@psibi psibi closed this Aug 14, 2024
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.

2 participants