In my program, I have a list of n elements.
I will repeat the list and initiate such a process:
Runtime.getRuntime.exec("cmd /C start abc.bat"+listitem() )
I need to support counting 4 processes. As soon as any of the processes is completed, I need to start the next process, so the number of processes should be 4.
I can initiate 4 processes at the same time, but I'm not sure how to save the score 4. In principle, I need some notification as soon as the process is completed, so I can start the next one, any streaming is possible.
Any help on how to implement this, can anyone share a fragment of this requirement?
source share