Skip to content

Commit

Permalink
Give some time for the threads to synchronize before starting them
Browse files Browse the repository at this point in the history
* Set the daemon flag of the threads during instantiation
  • Loading branch information
dnaeon committed Oct 14, 2013
1 parent aeb8ebf commit 550b423
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/vmpoller/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,15 @@ def run(self, config_file, start_agents=True):
# Create a DEALER socket for passing messages from our worker threads back to the clients
self.dealer = self.zcontext.socket(zmq.DEALER)
self.dealer.bind("inproc://workers")


# Create our threads
for i in xrange(self.threads_num):
thread = threading.Thread(target=self.worker_thread, args=("inproc://workers", self.zcontext))
thread = threading.Thread(target=self.worker_thread, args=("inproc://workers", self.zcontext), daemon=True)
self.threads.append(thread)
thread.daemon = True
thread.start()

# Start our threads
for eachThread in self.threads:
eachThread.start()

#zmq.proxy(self.router, self.dealer)

Expand Down

0 comments on commit 550b423

Please sign in to comment.