python - resource usage Queue.Queue.get(block = True) and threading.events.wait() -
i've got main thread produces work worker threads.
what best way in python set worker threads waiting till new work?
the thread halt @ line this:
new_work = self.worklist.get(block=true)
where self.worklist queue object
until main thread delivers new work.
or halt this:
self.wait_for_work.wait() new_work = self.worklist.get(block=false)
where self.wait_for_work threading.event object , assume main thread put new work item fifo on other side.
is there i'm missing here or more or less same?
any clarifications?
regards
Comments
Post a Comment