title: python multiprocessing process count
body: <pre><code>#coding:utf-8
  
  import sys
  import time
  import os
  import multiprocessing
  
  class Worker(object):
      def __init__(self):
          self.progress = 0
          self.task_info = None
  
      def init(self):
          pass
  
      def status(self):
          pass
  
      def set_task_info(self, task_info):
          self.task_info = task_info
  
      def run(self, worker_status_meta_dict):
          print multiprocessing.current_process()
          print "process is %d" % self.progress
          while self.progress &lt; 5:
              self.progress = self.progress +1
              worker_status_meta_dict['state'] = 0
              worker_status_meta_dict['status'] = "running"
              time.sleep(2)
          worker_status_meta_dict['state'] = 1
          worker_status_meta_dict['status'] = "succeeded"
          print "bavscan worker finished..."      
  
  if __name__ == "__main__":
      worker = Worker()
      worker_process_dict = multiprocessing.Manager().dict()
      process = multiprocessing.Process(target=Worker.run, args=(worker, worker_process_dict))
      process.start()
      time.sleep(60)
  </code></pre>
  
  <p>This is a simple demo for python multiprocess.
  The main process invoke the Worker.run method in a subprocess with multiprocessing.Process.
  When run it in wondows 7, the main process will lauch two subprocess.</p>
  
  <p><img src="https://i.stack.imgur.com/Mb0Rj.png" alt="enter image description"></p>