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(thread): Make spawnThreadTasks use a wait group & replace task params with TaskParams struct #300

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

InKryption
Copy link
Contributor

Extracted from some of my experimentation; doesn't appear to cause any measurable performance impact, reduces allocations (the total amount allocated will likely be similar since it's adding more metadata to the thread metadata), and overall seems to simplify and improve the code quality in my opinion.

Also resolves a TODO with a fairly simple solution.

Copy link
Contributor

@Rexicon226 Rexicon226 left a comment

Choose a reason for hiding this comment

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

Good changes overall.

src/utils/thread.zig Outdated Show resolved Hide resolved
0xNineteen
0xNineteen previously approved these changes Oct 7, 2024
Copy link
Contributor

@0xNineteen 0xNineteen left a comment

Choose a reason for hiding this comment

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

lgtm just a small nit

src/accountsdb/db.zig Outdated Show resolved Hide resolved
The function now takes only two arguments: the task function, and
a config struct which is parameterized on the task function type info
in order to also contain the parameter tuple.
Copy link
Contributor

@0xNineteen 0xNineteen left a comment

Choose a reason for hiding this comment

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

great improvement :shipit:

Copy link
Contributor

@Rexicon226 Rexicon226 left a comment

Choose a reason for hiding this comment

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

lgtm

@InKryption InKryption merged commit 534e83d into main Oct 8, 2024
6 checks passed
@InKryption InKryption deleted the ink/refactor-spawn-thread-tasks branch October 8, 2024 23:38
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