Skip to content

From inside a process, how can I check if there are other processes to run? #848

Closed Answered by Luc45
Luc45 asked this question in Q&A
Discussion options

You must be logged in to vote

I ended up using lock files, too.

  • Each subprocess that are not the first one creates a temporary lock file.
  • Every time a subprocess finishes, it deletes their own lock file.
  • The main process that won the race will glob that pattern and wait
  • Every time a main process wins the race, it deletes all lock files to cleanup the initial state as well (eg: to account for CTRL+C on a last test run where subprocess didn't clean after itself, etc)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Luc45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant