title: Passing parameter to function while multithreading
body: <p>I'm learning about multithreading and when I try to pass a parameter to my function in each thread it will process sequentially. Why is that?</p>
  <pre><code>import time
  import threading
  
  start = time.perf_counter()
  
  def sleepy_duck(name):
      print(name, &quot;duck going to sleep 1 sec&quot;)
      time.sleep(1)
      print(name, &quot;waking up&quot;)    
  
  
  t1 = threading.Thread(target=sleepy_duck(&quot;Johny&quot;))
  t2 = threading.Thread(target=sleepy_duck(&quot;Dicky&quot;))
  t3 = threading.Thread(target=sleepy_duck(&quot;Loly&quot;))
  
  t1.start()
  t2.start()
  t3.start()
  
  t1.join()
  t2.join()
  t3.join()
  
  finish = time.perf_counter()
  print(&quot;The ducks slept &quot;, finish-start, &quot; seconds.&quot;)
  </code></pre>
  <p>Result:</p>
  <pre><code>Johny duck going to sleep 1 sec
  Johny waking up
  Dicky duck going to sleep 1 sec
  Dicky waking up
  Loly duck going to sleep 1 sec
  Loly waking up
  The ducks slept  3.0227753  seconds.
  </code></pre>