I read a lot of about multiprocessing, threading but still i have problem with simple thing. I have 2 functions. I want call one by another and move one (this called function can't slow me up).
Example
def main():
print("my operations")
Thread(target=child(), args=()).start()
print("rest operations")
def child():
#here are some operations that takes 3 seconds
print("background operations")
The point is that operations from child function can not slow me down. I want to just call that function and move on. So I want output like that:
my operations rest operations background operations
But doing this using Thread(target=child(), args=()).start()
looks like
my operations
#then call child function wait 3 seconds
background operations rest operations
There is and option to do what I want ?
sleep
stops THE ENTIRE PROGRAM not just the thread it was called on. as an alternative you can use async programming