title: Same callback, multiple threads
body: <p>If I create multiple threads and I pass the same exact callback to all the threads, will these threads be executing the same block of memory (same function/callback) at the same time?  Are thread callbacks passed by value or by reference? And is this a language dependent feature? How would this work in Python due to the Global Interpreter lock vs a language such as C#?</p>
  
  <p>The below code shows different thread ID's being printed but what about the function location? Are there copies being made of LongOperation or is each thread accessing the same memory location each time their code is being run? </p>
  
  <p>Example code in python:</p>
  
  <pre><code>def LongOperation():
      print( "Spinning up a thread with this ID: " + str(threading.get_ident()))
      print("Finishing up thread ID: " + str(threading.get_ident()))
  
  i = 0
  while i &lt; 10:
      threading.Thread(target=LongOperation).start()
      i = i + 1
  </code></pre>
  
  <p>Thanks for reading.</p>