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

implement std.Progress for single-threaded mode #20101

Open
Tracked by #20059
andrewrk opened this issue May 29, 2024 · 0 comments
Open
Tracked by #20059

implement std.Progress for single-threaded mode #20101

andrewrk opened this issue May 29, 2024 · 0 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@andrewrk
Copy link
Member

Extracted from #20059.

std.Progress is currently implemented to do nothing for single-threaded builds:

const noop_impl = builtin.single_threaded or switch (builtin.os.tag) {

This means as a parent process it does not draw progress to the terminal, and as a child process it does not send progress updates to the parent over the provided pipe.

It could be implemented to share code with the multi-threaded version by doing the update thread's task, or the IPC thread's task in the function body of Node.end for example. It would be slightly less accurate than the threaded version because updates would only occur when starting or stopping another node - which means there is a pattern that could lead to a shorter-running Node being blamed for what was actually a longer-running Node's operation. It would work decently enough though.

Is it worth it? I think the perf penalty would be higher for single-threaded processes. I'm not sure if it would be worth it.

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library. labels May 29, 2024
@andrewrk andrewrk added this to the 1.0.0 milestone May 29, 2024
@andrewrk andrewrk mentioned this issue May 29, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

No branches or pull requests

1 participant