I have read few articles on threading python threads and about GIL.
I wrote a small program to understand some of the concepts
import threading
import time
def merge_array1(a1):
for x in a1:
print (x)
time.sleep(5)
def merge_array2(a1):
for x in a1:
print (x)
def run():
threading.Thread(merge_array1([5, 6, 7])).start()
threading.Thread(merge_array2([8,9,10])).start()
run()
Above program prints something 5,6,7,8,9,10 in sequence
But...i thought when one thread is sleeping, system will automatically run another thread
So output will be something similar to 5,8,9,10,6,7.
Am i missing something here, how to modify this program to give the output expected by me.