-
Notifications
You must be signed in to change notification settings - Fork 72
Implement multi threaded file processing #27
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
Conversation
|
Very helpful, thanks for working on this! I don't see a reason to convert the files from tabs to space indentation. I guess it is possible to change the clang-format config to match current style, and re-format with that instead? If we want to reformat the files with a tool like clang-format, then that should preferably be done in a separate PR, to make review easier. |
|
My bad, sorry. I shouldn't format the code. I should done it at other PR. The code style for arghandling.c is GNU, but elf-cleaner.cpp seems using different style. The closest one i could find is Mozilla with TabSize set to 2. Or i undo the formatting to make it easier? |
853a6da to
52f72be
Compare
|
@Grimler91 I undo the formatting and keep the code |
|
@XniceCraft great, thanks, will do some tests! I kept formatting in arghandling.c to make it as similar as possible to the source, but having different styles in different files is indeed confusing. Feel free to open another PR to convert them to the same style after this is merged (preferably GNU style). |
|
There seem to be some kind of memory issue here, if I run something like: then I get: running termux-elf-cleaner in the same loop under |
|
I found a solution. Instead of popping the item from deque (which is we need to copy the item to temporary store it), we create a variable that store the index that the thread need to access |
d9a61a2 to
f63b9b3
Compare
19a8c40 to
97ac438
Compare
Instead of copying the front item then temporary store it, we create a variable that store where the thread need to access (according to std::deque docs, accessing by index require constant time O(1))"
Needed on some systems to get pthread functions.
97ac438 to
2d93754
Compare
|
Thanks a lot, works in my tests now, roughly 10 times faster than before :) |
No description provided.