Lines Matching defs:pool

49 import multiprocessing.pool
2418 cls.pool = cls.Pool(4)
2422 cls.pool.terminate()
2423 cls.pool.join()
2424 cls.pool = None
2428 papply = self.pool.apply
2433 pmap = self.pool.map
2439 psmap = self.pool.starmap
2449 self.assertEqual(self.pool.starmap_async(mul, tuples).get(),
2453 self.assertEqual(self.pool.map_async(sqr, list(range(10))).get(),
2458 self.pool.map_async(int, ['1'],
2463 self.pool.map_async(int, ['a'],
2477 self.pool.map(sqr, [A()]*10)
2481 self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1)
2483 self.fail("pool.map_async with chunksize stalled on null list")
2491 self.pool.map(sqr, exception_throwing_generator(1, -1), 1)
2494 self.pool.map(sqr, exception_throwing_generator(1, -1), 1)
2497 self.pool.map(sqr, exception_throwing_generator(10, 3), 1)
2507 self.pool.map(sqr, SpecialIterable(), 1)
2509 self.pool.map(sqr, SpecialIterable(), 1)
2512 res = self.pool.apply_async(sqr, (7, TIMEOUT1,))
2518 res = self.pool.apply_async(sqr, (6, TIMEOUT2 + 1.0))
2524 it = self.pool.imap(sqr, list(range(10)))
2527 it = self.pool.imap(sqr, list(range(10)))
2532 it = self.pool.imap(sqr, list(range(1000)), chunksize=100)
2542 it = self.pool.imap(sqr, exception_throwing_generator(1, -1), 1)
2545 it = self.pool.imap(sqr, exception_throwing_generator(1, -1), 1)
2548 it = self.pool.imap(sqr, exception_throwing_generator(10, 3), 1)
2554 it = self.pool.imap(sqr, exception_throwing_generator(20, 7), 2)
2558 it = self.pool.imap(sqr, exception_throwing_generator(20, 7), 4)
2564 it = self.pool.imap_unordered(sqr, list(range(10)))
2567 it = self.pool.imap_unordered(sqr, list(range(1000)), chunksize=100)
2575 it = self.pool.imap_unordered(sqr,
2580 it = self.pool.imap_unordered(sqr,
2585 it = self.pool.imap_unordered(sqr,
2596 it = self.pool.imap_unordered(sqr,
2622 result = self.pool.map_async(
2625 self.pool.terminate()
2626 join = TimingWrapper(self.pool.join)
2628 # Sanity check the pool didn't wait for all tasks to finish
2672 self.assertIs(type(cause), multiprocessing.pool.RemoteTraceback)
2700 # Issue #20980: Should not wrap exception when using thread pool
2731 self.pool.map(identity, objs)
2737 # With a process pool, copies of the objects are returned, check
2745 pool = self.Pool(1)
2746 with pool:
2748 # call pool.terminate()
2749 # pool is no longer running
2752 # bpo-35477: pool.__enter__() fails if the pool is not running
2753 with pool:
2755 pool.join()
2761 pool = self.Pool(1)
2762 pool.terminate()
2763 pool.join()
2766 pool._state = multiprocessing.pool.RUN
2769 ('unclosed running multiprocessing pool', ResourceWarning)):
2770 pool = None
2798 from multiprocessing.pool import MaybeEncodingError
2801 # Make sure we don't lose pool processes because of encoding errors.
2834 # Refill the pool
2852 # Issue #10332: closing a pool whose workers have limited lifetimes
2876 self.pool = Pool(processes=1)
2880 problem.pool.map(float, tuple(range(10)))
4727 pool = multiprocessing.Pool(processes=4)
4728 x = pool.map(_afunc, [1, 2, 3, 4, 5, 6, 7])
4729 pool.close()
4730 pool.join()
5504 # Issue #19675: During pool creation, if we can't create a process,
5534 p = multiprocessing.pool.Pool(5, context=unittest.mock.MagicMock(