I want to write a command line utility that can be used to synchronize the execution off programs in different consoles.
Console A:
$ first_program && semaphore -signal
Console B:
$ semaphore -wait && second_program
The first program takes a long take to complete. The second program can only start when the first program has finished.
Which synchronization object do I need to implement this?
You don’t need to use Python for this. Considering you are using Unix, try this:
First, create a pipe for the semaphore.
Then, the programs:
Actually, this method works both ways. The read will block until there is a write, and vice versa.