I want to use SharpCompress in a program I am developing.
It's a file downloader for a private host (a winform app). It would do the same as jdownloader: once the file or files have been downloaded, it would call sharpcompress in the background in order to extract the files.
However I see that SharpCompress uses all the CPU. This is not desirable in my case because it should be a background process (better said, threat) and the CPU usage should be minimum.
Files could be small or huge - a 1MB zip, or a DVD9 image inside a 90 part RAR, for example, or a HD movie of 20-30GB.
So the user should be able to cancel the process (I have seen there is an issue #21 about that) and set priorities (or at least it should run at low priority).
Setting the thread with low priority doesn't work well, a sleep(1) is necessary when reading or writting a stream:
http://www.bluebytesoftware.com/blog/PermaLink,guid,1c013d42-c983-4102-9233-ca54b8f3d1a1.aspx
http://www.codinghorror.com/blog/2006/08/thread-priorities-are-evil.html
What I am planning is to create a custom DLL, downloading the code and modifying it for my case. I think I could create a shared class with two properties: abort and lowpriority.
While reading or writing the stream, it would check that properties. If lowpriority is set to "true" it would add a sleep(1). If abort is set to "true" it would stop the process, - I think it's better than doing a thread.abort!
Don't know if it is possible to implement something "neater" for allowing low priority execution and process cancellation.