Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Multi threading support #160

Open
matangpanchal opened this issue Apr 1, 2022 · 3 comments
Open

Multi threading support #160

matangpanchal opened this issue Apr 1, 2022 · 3 comments

Comments

@matangpanchal
Copy link

How can I use multi threading functionality to compress files. On your first page you have mentioned customparameters with the refrence of 7zip.chm file, but in my current version I can't any switch to use, and in the 7z.exe help there is a switch "-mmt" which i tried with your library then some "value out of acceptable range exception" is happening.
kindly let me know the workaround , otherwise unfortunately I will have to find any other solutions to compress my file only due to slow performance. because with the current implementation library takes 20 to 30 sec to compress files which from the 7zip UI i am able to compress in 10 to 15 seconds
Regards,
Matang

@Georodin
Copy link

I have the same question :)

@Chris3773
Copy link

In testing the newer versions of 7zip default to all CPU threads.

The custom parameter is set differently for multi threading. It uses mt with the thread count. I give it about 80% of the CPU.

var processorCount = (int)(Environment.ProcessorCount * .8);
compressor.CustomParameters.Add("mt", processorCount.ToString());

@valimaties
Copy link

Hi.
Is there a way to see how much of the processors is in use by the compression? It will be best to see a realtime usage of the processors with some events or something!
If mt is passed to library, how can we see each thread what is doing? Because I'm thinking that when we call the compression method with this custom parameter 7z library is creating some multi-threading processes. So, if you have multiple files for archiving each thread will compress a file? I don't understand how it is working...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants