I may be mistaken, but it seems pzstd is currently just an executable.
It could be interesting to turn it into a library with an API similar to zstd itself - this would allow other programs and bindings to other languages to use "parallel" zstd streams for instance.
This is indeed a medium term objective @gyscos .
pzstd is a C++11 program, and that's why it's separated into contrib/.
We'll have to convert the relevant source code into C first.
Which will happen soon ...
It might be possible to expose a "extern C" API on C++ code?
Somewhat yes, I guess it's only possible if the C++ code is C-like, aka no C++-only feature (template, objects, overloading, etc.).
But that's not the point.
Our main issue is portability.
We target a fairly wide range of systems and compilers.
C++11 is just too recent for this objective.
I see. Glad to know it's coming! :D
Zstandard v1.1.3 now supports multi-threading, from both command line and API (see zstdmt_compress.h).
This is still early days, so feature is not enabled by default : compilation needs to trigger the protection macro ZSTD_MULTITHREAD. There is a prepared target for the cli : make zstdmt.
The API is designed in a way which looks like the "regular" one, so transferring from one to the other should be straightforward. A long-term intention is to completely merge the MT API into the regular API. At which stage, specifying the nb of threads will just be a parameter.
But we need time to get there. In particular, we need to ensure the current solution compiles and behaves well on all supported platforms. We'll also have to support more variants than the ones already implemented in zstdmt_compress.h.
Most helpful comment
Somewhat yes, I guess it's only possible if the C++ code is C-like, aka no C++-only feature (template, objects, overloading, etc.).
But that's not the point.
Our main issue is portability.
We target a fairly wide range of systems and compilers.
C++11 is just too recent for this objective.