Message272125
A workaround for this on 3.5 and older versions is probably to do:
initialization:
num_q = queue.Queue()
map(num_q.put, range(max_workers))
Then schedule max_workers identical tasks:
def task():
threading.current_thread().name = '%s_%d' % (your_prefix, num_q.get())
num_q.task_done()
num_q.join() # block so that this thread cannot take a new thread naming task until all other tasks are complete. guaranteeing we are executed once per max_workers threads. |
|
Date |
User |
Action |
Args |
2016-08-07 17:12:51 | gregory.p.smith | set | recipients:
+ gregory.p.smith, durin42 |
2016-08-07 17:12:51 | gregory.p.smith | set | messageid: <1470589971.29.0.0330658203848.issue27664@psf.upfronthosting.co.za> |
2016-08-07 17:12:51 | gregory.p.smith | link | issue27664 messages |
2016-08-07 17:12:50 | gregory.p.smith | create | |
|