Is zlib threadsafe?

Frequently Asked Questions about zlib

  • Is zlib thread-safe?

    Yes. However any library routines that zlib uses and any application- provided memory allocation routines must also be thread-safe. zlib's gz* functions use stdio library routines, and most of zlib's functions use the library memory allocation routines by default. zlib's *Init* functions allow for the application to provide custom memory allocation routines.

    Of course, you should only operate on any given zlib or gzip stream from a single thread at a time.

  • 原文地址:https://www.cnblogs.com/lexus/p/2991786.html