I am pretty sure after our discussion in the comments that you may want to use the classical synchronization primitives, as documented e.g. here: https://docs.python.org/2/library/multiprocessing.html#synchronization-primitives.
The idea these tools/primitives have in common is to control and maintain determinism in your system comprised of multiple components. These primitives can make sure that things are processed in the right order, always. That is, these methods are able to create the determinism you are looking out for.
Of course you should read about what these primitives have been designed for. There are many resources out there. A good article on this topic may be this one here: http://www.cs.cf.ac.uk/Dave/C/node31.html (note that it deals with Unix internals and threads, but the ideas are the same for all operating systems and also across processes, not only threads).