开发者

windows bat's multithreading and execution of other application

开发者 https://www.devze.com 2023-01-24 13:18 出处:网络
New issue came up for me recently. I often must run simillar tasks and I would like to make my life easier.

New issue came up for me recently. I often must run simillar tasks and I would like to make my life easier.

Basicaly after choosing argument i always run one exe file with this argument开发者_如何学编程 and after that (these should work in the same time) I run bat file (with argument too).

After finishing I make some copies of generated files and move them to particular directories (all i based on argument sent while executing). Then all operations are reapeted many times.

Doing it manually is waist of time in my opinion.

Could you recommend any approach that would handle multithreading while working with files and directories?


Usually you want to avoid excessive parallelism when accessing a shared resource. As I understand it what you do there is not CPU- but I/O-bound, therefore running more in parallel just increases congestion.

Furthermore, you cannot do multithreading in batch files – the langauge simply does not have the concept of threads. You can run multiple processes in parallel by launching them via start, but you would have to keep track of the dependencies yourself as well as make sure that you don't run too many simultaneously.

0

精彩评论

暂无评论...
验证码 换一张
取 消