Multithread settings for Unix Archives in C#
Overview
XZ,
Bzip2 and
Lzip are common in Linux. Due to their block structure they can be compressed in several threads. Aspose.ZIP API provides CompressionThreads
properties for all of them to utilize several CPU cores on compression. Setting it to more than one entails multi core compression; leaving it one - the default option - leads to compression with single CPU core.
XZ multithreaded compression
There is
CompressionThreads property in XzArchiveSettings
.
The following code example shows how to compress a file using XzArchive instance.
Bzip2 multithreaded compression
There is
CompressionThreads property in Bzip2SaveOptions
.
The following code example shows how to compress a file using Bzip2Archive instance.
Lzip multithreaded compression
There is
CompressionThreads property in XzArchiveSettings
.
The following code example shows how to compress a file using XzArchive instance.
Four threads are used in all samples.