title: Timing out a multiprocessing function
body: <p>I need to set a time limit on a python function which use some multiprocessing stuff (I don't know if it matters). Something like this:</p>
  
  <pre><code>function(a_list):
  
       p1 = Process(a_list[0:len(a_list/2)])
       p2 = Process(a_list[len(a_list)/2: len(a_list)])
  
       //start and join p1, p2
  </code></pre>
  
  <p>I look around the net and I found a time out decorator but it looks quite tricky and verbose (I'm newbie on decorators). What I'd want is a simple thing.</p>
  
  <p>EDIT:</p>
  
  <p>I think I made it too simple.
  My program iterates over the above function and store result in a list something like this:</p>
  
  <pre><code>while(something):
  
       retval = function(some_list)  # here I need the time out thing
  
       # if function timed out then skip
  
       ris_list.append(retval)
  </code></pre>