Author gregory.p.smith
Recipients durin42, gregory.p.smith
Date 2016-08-07.17:12:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470589971.29.0.0330658203848.issue27664@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-08-07 17:12:51gregory.p.smithsetrecipients: + gregory.p.smith, durin42
2016-08-07 17:12:51gregory.p.smithsetmessageid: <1470589971.29.0.0330658203848.issue27664@psf.upfronthosting.co.za>
2016-08-07 17:12:51gregory.p.smithlinkissue27664 messages
2016-08-07 17:12:50gregory.p.smithcreate