When you write Python code, it is run serially, not in parallel. If you have this code
- Code: Select all
from time import sleep
print "Beginning call()"
print "Completed call()"
where the first call()
takes 61 seconds, the the second one will not start until the first is finished.
The typical way to get them to run at the same time is threading
. It takes extra effort to get concurrency. People new to programming or Python don't tend to get to it until they have learned quite a bit more.
You seem to be assuming that a subsequent call in your code will begin immediately after the first begins. So with the information you've provided so far (without any code), we can't tell if it's a misconception on your part or if you're using a specialized framework or library in which things actually are
done in parallel, which if that's the case, we can't answer your question anyway without knowing how that framework/library does things. With regular threads it is a new "instance" as you said, and it seems likely that if you are using something specialized that the first function call wouldn't be killed by the second one beginning, but we can't answer with certainty.
I hope I've been clear. If not, please provide more information in any subsequent questions, and avoid assuming that mentioning "opengate()" out of context will help us to help you.