()
| 12 | |
| 13 | |
| 14 | def test_func(): |
| 15 | code = random.randrange(0, 1000) |
| 16 | queue = multiprocessing.Queue() |
| 17 | fill_pool = multiprocessing.Process( |
| 18 | target=fill_queue, |
| 19 | args=(queue, code) |
| 20 | ) |
| 21 | drain_pool = multiprocessing.Process( |
| 22 | target=drain_queue, |
| 23 | args=(queue, code) |
| 24 | ) |
| 25 | drain_pool.start() |
| 26 | fill_pool.start() |
| 27 | fill_pool.join() |
| 28 | drain_pool.join() |
| 29 | |
| 30 | |
| 31 | def main(): |