-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
fix non-responsive Ctrl-C during disk-usage sorting #1236
Conversation
We want to skip a check at every file. Can we do this when we encounter a directory instead? Please share the performance data of current and new in cache-dropped state as well. |
Unrelated to this PR, currently 1 thread processes a sub-directory tree under the directory where you do du. Say, at /, 1 thread processes each thread. The problem is - /bin pr /lib takes muck longer. See if we can do 1 dir (not the full tree) per thread. I guess if we try that, we will have to store the subtree's top directory info with the directories as the size should reflect for that dir visually. |
@@ -346,6 +346,7 @@ typedef struct { | |||
|
|||
/* Non-persistent program-internal states (alphabeical order) */ | |||
typedef struct { | |||
uint_t interrupt; /* Program received an interrupt */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't add a full uint here. Why is the bit not working? It is written in global scope and the threads only read it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the threads need to read this atomically as none of them changes it.
Thanks for taking a look. I'm pretty new to nnn, and don't have the bandwidth to really dig in and learn the code in depth. That said, I saw that I added the atomic operations around access to Please feel free to incorporate whatever ideas from this PR you'd like, and change the rest. Thanks! |
That's global. Also we clear in global scope. Currently dirwalk doesn't add a new dir when the interrupt is set.
I will refer to this PR and incorporate the changes when I get the time. |
Commit 4c705a9 should work for you. |
Yes! Works great so far. Much simpler than what I had. Thanks! |
Thanks for the confirmation. |
Ctrl-C wasn't being noticed during a disk-usage sorting, effectively meaning there was no way to cancel the operation except to wait it out.
Tested on Ubuntu 20.04 and an old MacOS 10.11.6 (El Capitan).
Thanks for a great program!
-Dan