Esempio n. 1
0
            break
    print("")
    y = m.get()
    print("I'm awake")
    print("y = %s" % str(y[:10]))


if __name__ == '__main__':
    x = list(range(500))
    delay = 0.01
    maxtries = 200
    f = busy_add
    #f = busy_squared
    #f = squared

    #from pathos.pools import ProcessPool as Pool
    #from pathos.pools import ThreadPool as Pool
    from pathos.pools import ParallelPool as Pool
    #from pathos.helpers import freeze_support, shutdown
    #freeze_support()

    pool = Pool(nodes=4)
    test_ready(pool, f, maxtries, delay)

    # shutdown
    pool.close()
    pool.join()
    pool.clear()

# EOF