inter thread/process synchronisation introduction in this we will look at several facilities supported by both the threading and multiprocessing libraries that allow for synchronisation and cooperation between threads or processes in the remainder of this we will look at some of the ways in which python supports synchronisation between multiple threads and processes note that most of the libraries are mirrored between threading and multiprocessing so that the same basic ideas hold for both approaches within the mainvery similar apis howeveryou should not mix and match threads and processes if you are using threads then you should only use facilities from the threading library in turn if you are using processes than you should only use facilities in the multiprocessing library the examples given in this will use one or other of the technologies but are relevant for both approaches using barrier using threading barrier (or multiprocessing barrieris one of the simplest ways in which the execution of set of threads (or processescan be synchronised the threads or processes involved in the barrier are known as the parties that are taking part in the barrier each of the parties in the barrier can work independently until it reaches the barrier point in the code the barrier represents an end point that all parties must reach before any further behaviour can be triggered at the point that all the parties reach the barrier it is possible to optionally trigger post-phase action (also known as the barrier callbackthis post-phase action represents some behaviour that should be run when (cspringer nature switzerland ag huntadvanced guide to python programmingundergraduate topics in computer science