MCPcopy Index your code
hub / github.com/python/cpython / test_decompress_shared_dict

Method test_decompress_shared_dict

Lib/test/test_zstd.py:2776–2797  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2774 @threading_helper.reap_threads
2775 @threading_helper.requires_working_threading()
2776 def test_decompress_shared_dict(self):
2777 num_threads = 8
2778
2779 def run_method(b):
2780 # sync threads to increase chance of contention on
2781 # decompression dictionary
2782 b.wait()
2783 ZstdDecompressor(zstd_dict=TRAINED_DICT.as_digested_dict)
2784 b.wait()
2785 ZstdDecompressor(zstd_dict=TRAINED_DICT.as_undigested_dict)
2786 b.wait()
2787 ZstdDecompressor(zstd_dict=TRAINED_DICT.as_prefix)
2788 threads = []
2789
2790 b = threading.Barrier(num_threads)
2791 for i in range(num_threads):
2792 thread = threading.Thread(target=run_method, args=(b,))
2793
2794 threads.append(thread)
2795
2796 with threading_helper.start_threads(threads):
2797 pass
2798
2799
2800if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

BarrierMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected