multithreading - Python basic threading issue -


trying simple threading operation queues. there's no run error, function isn't executing.

heres code:

data = ['1', '2', '3']  def do_stuff(arg1):     print arg1  def start(num_threads):     q = queue.queue()     item in data:        q.put(item)      in xrange(num_threads):         t = threading.thread(target=run, args=(do_stuff, q))         t.start()  def run(func, queue):     while queue:         try:             func(queue.get(false))         except queue.empty:             break  start(2) 


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -