Anyone to ensure functions get run consecutively (and not simultaneously)?
I'm working on a project right now, and I've got 6 functions that I want to run in the main. They all do what they're supposed to do, and I've all got them outputting each of their steps to a log file for testing purposes.
Anyway, I've noticed that, although all the functions are called in order, they don't quite seem to be executing the way I want them to. I'd like for function 2 only to start when function 1 ends. I suppose I could call function 2 at the end of function 1, but just wanted to know if there was another way to go about doing this.
Note: Within these 6 functions, other functions are also being called. I'm not sure if that will affect anything.
Thanks in advance for any help you can offer.
Re: Anyone to ensure functions get run consecutively (and not simultaneously)?
They are being run in serial, your code has a bug in it which is making you think otherwise. The compiler doesn't generate code that jumps around randomly. Code in a thread is executed in serial.
Re: Anyone to ensure functions get run consecutively (and not simultaneously)?
unless the main thread is kicking off async stuff in other threads. Really no way to know without seeing any code.