Here the zip function effectively saves the zipped file in Binary format. This code also allows the user to select the number of threads! It effectively uses the required amount of dynamic memory and frees the threads and the memory after its completions! Hence, minimizing memory leaks and making it ThreadSafe!