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

Method test_many_threads

Lib/test/test_queue.py:969–977  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

967
968 @bigmemtest(size=50, memuse=100*2**20, dry_run=False)
969 def test_many_threads(self, size):
970 # Test multiple concurrent put() and get()
971 q = self.q
972 inputs = list(range(10000))
973 results = self.run_threads(size, q, inputs, self.feed, self.consume)
974
975 # Multiple consumers without synchronization append the
976 # results in random order
977 self.assertEqual(sorted(results), inputs)
978
979 @bigmemtest(size=50, memuse=100*2**20, dry_run=False)
980 def test_many_threads_nonblock(self, size):

Callers

nothing calls this directly

Calls 3

run_threadsMethod · 0.95
listClass · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected