It might be good to note that a machine level mutex is probably not a solution here and for a pair of reasons:
1) Almost the entire operation would need to be locked by the Mutex as it is currently implemented
2) While this would work with a machine level mutex solution:
parallel 'juju add-model m{1}{2} --no-switch --debug; time wait' ::: `seq 0 9` ::: `seq 0 9`
the following would not:
parallel -Smachine1, machine2 'juju add-model m{1}{2} --no-switch --debug; time wait' ::: `seq 0 9` ::: `seq 0 9`
It might be good to note that a machine level mutex is probably not a solution here
and for a pair of reasons:
1) Almost the entire operation would need to be locked by the Mutex as it is currently implemented
2) While this would work with a machine level mutex solution:
parallel 'juju add-model m{1}{2} --no-switch --debug; time wait' ::: `seq 0 9` ::: `seq 0 9`
the following would not:
parallel -Smachine1, machine2 'juju add-model m{1}{2} --no-switch --debug; time wait' ::: `seq 0 9` ::: `seq 0 9`