title: use fork to execute a python function defined in the same script
body: <p>My python function would be like below format.</p>
  
  <pre><code>def f1():
   &lt;function code&gt;
  def f2():
   &lt;function code&gt;
  while True:
   if(first condition success):
   f1()
   if(second condition success):
   f2()
   time.sleep(60)
  </code></pre>
  
  <p>In the infinite loop I wanted to implement <code>fork()</code> and execute the functions in <code>parallel</code> on separate threads if the condition succeeds. Presently the functions execute one after the other when both the conditions succeed.<br>
  My expected code would be similar to</p>
  
  <pre><code>while True:
   if(first condition success):
   #os.fork() execute only f1()
   if(second condition success):
   #os.fork() execute only f1()
   time.sleep(60)
  </code></pre>