| 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 | |
| 2800 | if __name__ == "__main__": |